chore: migrate repository to project-pro

This commit is contained in:
2026-03-11 00:13:02 +01:00
parent 4a4ad79076
commit 481271c972
1005 changed files with 262765 additions and 1397 deletions

44
AGENTS.md Normal file
View File

@@ -0,0 +1,44 @@
# Repository Guidelines
## Project Structure & Module Organization
This repository is a WordPress site snapshot. Most contributor work should be limited to custom code:
- `wp-content/themes/restly-child/`: primary customization area (`functions.php`, `assets/js/custom.js`, `assets/styles/custom.scss`, generated `custom.css`).
- `wp-content/themes/restly-child/plugins/CookieNoticePro/`: child-theme-local cookie notice assets.
- `mail-test/`: standalone PHPMailer test utility.
Treat `wp-content/plugins/`, `wp-content/uploads/`, and bundled default themes as third-party or generated content unless a task explicitly requires changing them.
## Build, Test, and Development Commands
Run commands from repository root.
- `php -l wp-content/themes/restly-child/functions.php`: syntax-check child theme PHP.
- `php -l mail-test/index.php`: syntax-check mail test script.
- `npx sass wp-content/themes/restly-child/assets/styles/custom.scss wp-content/themes/restly-child/assets/styles/custom.css --style=expanded`: compile SCSS to CSS.
- `git diff -- wp-content/themes/restly-child`: review only intended child-theme changes before commit.
No unified CI pipeline is configured in this repo; validate changes in a local WordPress instance.
## Coding Style & Naming Conventions
- Use 4 spaces in PHP, semicolons required, and WordPress-style function names (`snake_case`, prefix custom helpers).
- Use 2 spaces in JS/SCSS to match existing `custom.js` and `custom.scss` style.
- Keep custom logic inside child theme files; avoid editing plugin vendor code.
- Prefer descriptive IDs/classes and file names like `custom.js`, `custom.scss` for theme-level overrides.
## Testing Guidelines
Automated tests are not currently present for custom code. Minimum validation per change:
- PHP lint for edited `.php` files.
- Manual browser QA for header behavior, accordions, and email-reveal interactions driven by `assets/js/custom.js`.
- Re-test desktop and mobile layouts after SCSS updates.
## Commit & Pull Request Guidelines
Current history includes mixed quality messages (`FIX: ...`, `REFactor: ...`, and generic `Save`). Use clear, imperative commits going forward:
- `fix: correct header z-index on sticky state`
- `refactor: isolate scroll handler in custom.js`
PRs should include:
- Scope summary and changed paths.
- Before/after screenshots for UI changes.
- Manual test notes (what was checked and where).
- Linked issue/task when available.
## Security & Configuration Tips
Do not commit secrets (SMTP logins, API keys, production emails). Move credentials to environment-specific configuration and rotate any exposed values immediately.

212
temp-article.html Normal file

File diff suppressed because one or more lines are too long

76
temp-authors-inline.css Normal file
View File

@@ -0,0 +1,76 @@
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-avatar img {
width: 80px !important;
height: 80px !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-avatar img {
border-radius: 50% !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a {
background-color: #655997 !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a {
color: #ffffff !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a:hover {
color: #ffffff !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
background-color: #655997 !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
border-radius: 100% !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
color: #ffffff !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data:hover {
color: #ffffff !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
background-color: #655997 !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
border-radius: 100% !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
color: #ffffff !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data:hover {
color: #ffffff !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-recent-posts-title {
border-bottom-style: dotted !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
border-style: solid !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
border-width: 1px !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
border-color: #999 !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
color: #3c434a !important;
}
.pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
border-radius: px !important;
}

File diff suppressed because one or more lines are too long

View File

@@ -3914,14 +3914,12 @@
background: #fff;
box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
clip: rect(0, 0, 0, 0);
-webkit-clip-path: inset(100% 100%);
clip-path: inset(100% 100%);
clip-path: inset(100% 100%);
}
.chosen-container.chosen-with-drop .chosen-drop {
clip: auto;
-webkit-clip-path: none;
clip-path: none;
clip-path: none;
}
.chosen-container a {
@@ -4032,8 +4030,7 @@
.chosen-container-single.chosen-container-single-nosearch .chosen-search {
position: absolute;
clip: rect(0, 0, 0, 0);
-webkit-clip-path: inset(100% 100%);
clip-path: inset(100% 100%);
clip-path: inset(100% 100%);
}
.chosen-container .chosen-results {

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"sources":["editor-v2-overrides.scss","editor-v2-overrides.css"],"names":[],"mappings":"AAAA;;EAAA;AAIA;EACC,gCAAA;ACAD;;ADGA;EACC,qDAAA;ACAD;;ADGA;EACC,oDAAA;EACA,oCAAA;ACAD;;ADGA;;;EAGC,aAAA;ACAD;;ADGA;EACC,gBAAA;EACA,uCAAA;EACA,kCAAA;EACA,gCAAA;EACA,YAAA;ACAD;;ADIA;EACC,4CAAA;ACDD;ADGC;EACC,aAAA;EACA,sBAAA;EACA,YAAA;ACDF;ADGE;EACC,YAAA;ACDH;ADGG;EACC,uBAAA;ACDJ","file":"editor-v2-overrides.css"}
{"version":3,"sources":["editor-v2-overrides.scss","editor-v2-overrides.css"],"names":[],"mappings":"AAAA;;EAAA;AAIA;EACC,gCAAA;ACAD;;ADGA;EACC,qDAAA;ACAD;;ADGA;EACC,oDAAA;EACA,oCAAA;ACAD;;ADGA;;;EAGC,aAAA;ACAD;;ADGA;EACC,gBAAA;EACA,uCAAA;EACA,kCAAA;EACA,gCAAA;EACA,YAAA;ACAD;;ADIA;EACC,4CAAA;ACDD;ADGC;EACC,aAAA;EACA,sBAAA;EACA,YAAA;ACDF;ADGE;EACC,YAAA;ACDH;ADGG;EACC,uBAAA;ACDJ","file":"editor-v2-overrides.css","sourcesContent":["/**\r\n * Here should be only styles that related to the Editor v1, and should be overridden when using the Editor v2.\r\n */\r\n\r\nbody {\r\n\t--editor-v2-top-bar-height: 48px;\r\n}\r\n\r\n#elementor-editor-wrapper {\r\n\theight: calc(100vh - var(--editor-v2-top-bar-height));\r\n}\r\n\r\nbody.elementor-navigator-docked #elementor-navigator {\r\n\theight: calc(100% - var(--editor-v2-top-bar-height));\r\n\ttop: var(--editor-v2-top-bar-height);\r\n}\r\n\r\n.elementor-panel #elementor-panel-header-menu-button,\r\n.elementor-panel #elementor-panel-header-add-button,\r\n.elementor-panel #elementor-panel-footer {\r\n\tdisplay: none;\r\n}\r\n\r\n.elementor-panel #elementor-panel-header {\r\n\tfont-weight: 700;\r\n\tbackground-color: var( --e-a-bg-default );\r\n\tcolor: var( --e-a-color-txt-accent );\r\n\tborder-bottom: var( --e-a-border );\r\n\theight: 48px;\r\n}\r\n\r\n// Make the MCE full-screen work properly with the top bar.\r\n.elementor-control-type-wysiwyg .mce-fullscreen {\r\n\tinset: var(--editor-v2-top-bar-height) 0 0 0;\r\n\r\n\t& > .mce-container-body {\r\n\t\tdisplay: flex;\r\n\t\tflex-direction: column;\r\n\t\theight: 100%;\r\n\r\n\t\t& > .mce-edit-area {\r\n\t\t\tflex-grow: 1;\r\n\r\n\t\t\t& > iframe {\r\n\t\t\t\theight: 100% !important;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","/**\n * Here should be only styles that related to the Editor v1, and should be overridden when using the Editor v2.\n */\nbody {\n --editor-v2-top-bar-height: 48px;\n}\n\n#elementor-editor-wrapper {\n height: calc(100vh - var(--editor-v2-top-bar-height));\n}\n\nbody.elementor-navigator-docked #elementor-navigator {\n height: calc(100% - var(--editor-v2-top-bar-height));\n top: var(--editor-v2-top-bar-height);\n}\n\n.elementor-panel #elementor-panel-header-menu-button,\n.elementor-panel #elementor-panel-header-add-button,\n.elementor-panel #elementor-panel-footer {\n display: none;\n}\n\n.elementor-panel #elementor-panel-header {\n font-weight: 700;\n background-color: var(--e-a-bg-default);\n color: var(--e-a-color-txt-accent);\n border-bottom: var(--e-a-border);\n height: 48px;\n}\n\n.elementor-control-type-wysiwyg .mce-fullscreen {\n inset: var(--editor-v2-top-bar-height) 0 0 0;\n}\n.elementor-control-type-wysiwyg .mce-fullscreen > .mce-container-body {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.elementor-control-type-wysiwyg .mce-fullscreen > .mce-container-body > .mce-edit-area {\n flex-grow: 1;\n}\n.elementor-control-type-wysiwyg .mce-fullscreen > .mce-container-body > .mce-edit-area > iframe {\n height: 100% !important;\n}"]}

View File

@@ -1 +1 @@
{"version":3,"sources":["preview-iframe.scss","preview-iframe.css"],"names":[],"mappings":"AAAA;EACC,YAAA;EACA,kBAAA;ACCD;ADCC;EACC,MAAA;EACA,OAAA;EACA,kBAAA;EACA,YAAA;EACA,qBAAA;EACA,YAAA;ACCF;ADEC;EACC,YAAA;ACAF","file":"preview-iframe.css"}
{"version":3,"sources":["preview-iframe.scss","preview-iframe.css"],"names":[],"mappings":"AAAA;EACC,YAAA;EACA,kBAAA;ACCD;ADCC;EACC,MAAA;EACA,OAAA;EACA,kBAAA;EACA,YAAA;EACA,qBAAA;EACA,YAAA;ACCF;ADEC;EACC,YAAA;ACAF","file":"preview-iframe.css","sourcesContent":[".site-editor__preview-iframe {\r\n\theight: 50vh;\r\n\tposition: relative;\r\n\r\n\t&__iframe {\r\n\t\ttop: 0;\r\n\t\tleft: 0;\r\n\t\tposition: absolute;\r\n\t\tborder: none;\r\n\t\ttransform-origin: 0 0;\r\n\t\theight: 100%;\r\n\t}\r\n\r\n\t&--header, &--footer{\r\n\t\theight: 15vh;\r\n\t}\r\n}\r\n",".site-editor__preview-iframe {\n height: 50vh;\n position: relative;\n}\n.site-editor__preview-iframe__iframe {\n top: 0;\n left: 0;\n position: absolute;\n border: none;\n transform-origin: 0 0;\n height: 100%;\n}\n.site-editor__preview-iframe--header, .site-editor__preview-iframe--footer {\n height: 15vh;\n}"]}

View File

@@ -1 +1 @@
{"version":3,"sources":["add-new.scss","add-new.css"],"names":[],"mappings":"AAAA;EACC,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,UAAA;EACA,kDAAA;ACCD","file":"add-new.css"}
{"version":3,"sources":["add-new.scss","add-new.css"],"names":[],"mappings":"AAAA;EACC,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,UAAA;EACA,kDAAA;ACCD","file":"add-new.css","sourcesContent":[".eps-add-new__overlay {\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tjustify-content: center;\r\n\topacity: 1;\r\n\t--card-image-overlay-background-color: transparent;\r\n}\r\n",".eps-add-new__overlay {\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 1;\n --card-image-overlay-background-color: transparent;\n}"]}

View File

@@ -1 +1 @@
{"version":3,"sources":["template-type.scss","template-type.css"],"names":[],"mappings":"AACC;EACC,6BAAA;ACAF;ADEE;EACC,oBAAA;ACAH;ADIC;EACC,6BAAA;ACFF","file":"template-type.css"}
{"version":3,"sources":["template-type.scss","template-type.css"],"names":[],"mappings":"AACC;EACC,6BAAA;ACAF;ADEE;EACC,oBAAA;ACAH;ADIC;EACC,6BAAA;ACFF","file":"template-type.css","sourcesContent":[".e-site-editor__templates {\r\n\t.page-header {\r\n\t\tmargin-block-end: spacing(10);\r\n\r\n\t\t> a {\r\n\t\t\talign-self: baseline;\r\n\t\t}\r\n\t}\r\n\r\n\t.eps-separator {\r\n\t\tmargin-block-end: spacing(44);\r\n\t}\r\n}\r\n",".e-site-editor__templates .page-header {\n margin-block-end: spacing(10);\n}\n.e-site-editor__templates .page-header > a {\n align-self: baseline;\n}\n.e-site-editor__templates .eps-separator {\n margin-block-end: spacing(44);\n}"]}

View File

@@ -1 +1 @@
{"version":3,"sources":["site-editor.scss","site-editor.css"],"names":[],"mappings":"AAAA;EACC,sBAAA;EACA,gBAAA;EACA,iBAAA;ACCD;;ADEA;EACC,OAAA;ACCD;;ADEA;EACC,cAAA;EACA,gCAAA;ACCD","file":"site-editor.css"}
{"version":3,"sources":["site-editor.scss","site-editor.css"],"names":[],"mappings":"AAAA;EACC,sBAAA;EACA,gBAAA;EACA,iBAAA;ACCD;;ADEA;EACC,OAAA;ACCD;;ADEA;EACC,cAAA;EACA,gCAAA;ACCD","file":"site-editor.css","sourcesContent":[".e-site-editor__content_container {\r\n\tflex-direction: column;\r\n\tmin-height: 100%;\r\n\tflex-wrap: nowrap;\r\n}\r\n\r\n.e-site-editor__content_container_main {\r\n\tflex: 1;\r\n}\r\n\r\n.e-site-editor__content_container_secondary {\r\n\tmargin: 0 auto;\r\n\tpadding-block-start: spacing(44);\r\n}\r\n",".e-site-editor__content_container {\n flex-direction: column;\n min-height: 100%;\n flex-wrap: nowrap;\n}\n\n.e-site-editor__content_container_main {\n flex: 1;\n}\n\n.e-site-editor__content_container_secondary {\n margin: 0 auto;\n padding-block-start: spacing(44);\n}"]}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
<?php
/**
* @package MultipleAuthors\
* @author PublishPress <help@publishpress.com>
* @copyright Copyright (C) 2018 PublishPress. All rights reserved.
* @license GPLv2 or later
* @since 1.0.0
*/
global $multiple_authors_addon;
$multiple_authors_addon->activation_hook();

View File

@@ -0,0 +1,23 @@
<?php
/**
* @package MultipleAuthors\
* @author PublishPress <help@publishpress.com>
* @copyright Copyright (C) 2018 PublishPress. All rights reserved.
* @license GPLv2 or later
* @since 1.0.7
*
* @deprecated 3.2.5-beta.8
*/
require_once __DIR__ . '/src/functions/bylines-functions.php';
if (!class_exists('PublishPress_Authors_Bylines_Functions')) {
/**
* Class PublishPress_Authors_Bylines_Functions
*
* @deprecated 3.2.5-beta.8
*/
class PublishPress_Authors_Bylines_Functions
{
}
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* @package MultipleAuthors\
* @author PublishPress <help@publishpress.com>
* @copyright Copyright (C) 2018 PublishPress. All rights reserved.
* @license GPLv2 or later
* @since 1.0.7
*
* @deprecated 3.2.5-beta.8
*/
require_once __DIR__ . '/src/functions/coauthors-functions.php';
if (!class_exists('PublishPress_Authors_CoAuthors_Functions')) {
/**
* Class PublishPress_Authors_CoAuthors_Functions
*
* @deprecated 3.2.5-beta.8
*/
class PublishPress_Authors_CoAuthors_Functions
{
}
}

View File

@@ -0,0 +1,65 @@
<?php
/**
* File responsible for defining basic general constants used by the plugin.
*
* @package MultipleAuthors
* @author PublishPress <help@publishpress.com>
* @copyright Copyright (C) 2018 PublishPress. All rights reserved.
* @license GPLv2 or later
* @since 1.0.0
*/
defined('ABSPATH') or die('No direct script access allowed.');
if (!defined('PP_AUTHORS_LOADED')) {
define('PP_AUTHORS_VERSION', '4.13.0');
define('PP_AUTHORS_FILE', 'publishpress-authors/publishpress-authors.php');
define('PP_AUTHORS_BASE_PATH', plugin_dir_path(__DIR__ . '/publishpress-authors.php'));
define('PP_AUTHORS_MODULES_PATH', PP_AUTHORS_BASE_PATH . 'src/modules/');
if (! defined('PP_AUTHORS_VENDOR_PATH')) {
/**
* @deprecated 4.2.0 Use PP_AUTHORS_LIB_VENDOR_PATH instead.
*/
define('PP_AUTHORS_VENDOR_PATH', PP_AUTHORS_LIB_VENDOR_PATH);
}
define('PP_AUTHORS_URL', rtrim(plugins_url('/', PP_AUTHORS_BASE_PATH . 'publishpress-authors.php'), '/') . '/');
define('PP_AUTHORS_ASSETS_URL', PP_AUTHORS_URL . 'src/assets/');
define('PP_AUTHORS_AUTOLOAD_CLASS_NAME', 'ComposerStaticInit92fc51e620da052063312bd38c6157a4');
define('PP_AUTHORS_VIEWS_PATH', PP_AUTHORS_BASE_PATH . 'src/views');
if (!defined('PUBLISHPRESS_AUTHORS_LOAD_DEPRECATED_LEGACY_CODE')) {
define('PUBLISHPRESS_AUTHORS_LOAD_DEPRECATED_LEGACY_CODE', true);
}
if (!defined('PUBLISHPRESS_AUTHORS_LOAD_LEGACY_SHORTCODES')) {
define('PUBLISHPRESS_AUTHORS_LOAD_LEGACY_SHORTCODES', true);
}
if (!defined('PUBLISHPRESS_AUTHORS_LOAD_COAUTHORS_FUNCTIONS')) {
define('PUBLISHPRESS_AUTHORS_LOAD_COAUTHORS_FUNCTIONS', true);
}
if (!defined('PUBLISHPRESS_AUTHORS_LOAD_BYLINES_FUNCTIONS')) {
define('PUBLISHPRESS_AUTHORS_LOAD_BYLINES_FUNCTIONS', true);
}
if (!defined('PUBLISHPRESS_AUTHORS_SYNC_POST_AUTHOR_CHUNK_SIZE')) {
define('PUBLISHPRESS_AUTHORS_SYNC_POST_AUTHOR_CHUNK_SIZE', 10);
}
if (!defined('PUBLISHPRESS_AUTHORS_SYNC_AUTHOR_SLUG_CHUNK_SIZE')) {
define('PUBLISHPRESS_AUTHORS_SYNC_AUTHOR_SLUG_CHUNK_SIZE', 50);
}
if (!defined('PUBLISHPRESS_AUTHORS_LOAD_STYLE_IN_FRONTEND')) {
define('PUBLISHPRESS_AUTHORS_LOAD_STYLE_IN_FRONTEND', true);
}
if (!defined('PUBLISHPRESS_AUTHORS_FLUSH_REWRITE_RULES')) {
define('PUBLISHPRESS_AUTHORS_FLUSH_REWRITE_RULES', false);
}
define('PP_AUTHORS_LOADED', true);
}

View File

@@ -0,0 +1,53 @@
<?php
/**
* @package MultipleAuthors\
* @author PublishPress <help@publishpress.com>
* @copyright Copyright (C) 2018 PublishPress. All rights reserved.
* @license GPLv2 or later
* @since 1.0.0
*
* The IDE can probably display the following aliases as Ignored Class Aliases Declarations,
* but that is happening because we created a .ide.php file defining those classes with the
* a deprecated attribute in the comments, for the IDE is able to recognize it as deprecated.
* Just ignore the warning.
*/
class_alias('MultipleAuthors\\Plugin', 'PP_Multiple_authors_plugin');
class_alias('MultipleAuthors\\Container', 'PublishPress\\Addon\\Multiple_authors\\Container');
class_alias('MultipleAuthors\\Factory', 'PublishPress\Addon\Multiple_authors\Factory');
class_alias('MultipleAuthors\\Services', 'PublishPress\Addon\Multiple_authors\Services');
class_alias('MultipleAuthors\\Widget', 'PublishPress\Addon\Multiple_authors\Widget');
class_alias('MultipleAuthors\\Classes\\Admin_Ajax', 'PublishPress\\Addon\\Multiple_authors\\Classes\\Admin_Ajax');
class_alias(
'MultipleAuthors\\Classes\\Author_Editor',
'PublishPress\\Addon\\Multiple_authors\\Classes\\Author_Editor'
);
class_alias(
'MultipleAuthors\\Classes\\Authors_Iterator',
'PublishPress\\Addon\\Multiple_authors\\Classes\\Authors_Iterator'
);
class_alias(
'MultipleAuthors\\Classes\\Authors_Iterator',
'Multiple_authors_iterator'
);
class_alias('MultipleAuthors\\Classes\\CLI', 'PublishPress\\Addon\\Multiple_authors\\Classes\\CLI');
class_alias(
'MultipleAuthors\\Classes\\Content_Model',
'PublishPress\\Addon\\Multiple_authors\\Classes\\Content_Model'
);
class_alias('MultipleAuthors\\Classes\\Installer', 'PublishPress\\Addon\\Multiple_authors\\Classes\\Installer');
class_alias('MultipleAuthors\\Classes\\Post_Editor', 'PublishPress\\Addon\\Multiple_authors\\Classes\\Post_Editor');
class_alias('MultipleAuthors\\Classes\\Query', 'PublishPress\\Addon\\Multiple_authors\\Classes\\Query');
class_alias('MultipleAuthors\\Classes\\Utils', 'PublishPress\\Addon\\Multiple_authors\\Classes\\Utils');
class_alias(
'MultipleAuthors\\Classes\\Objects\\Author',
'PublishPress\\Addon\\Multiple_authors\\Classes\\Objects\\Author'
);
class_alias(
'MultipleAuthors\\Classes\\Integrations\\Theme',
'PublishPress\\Addon\\Multiple_authors\\Classes\\Integrations\\Theme'
);
if (!defined('PUBLISHPRESS_MULTIPLE_AUTHORS_VERSION')) {
define('PUBLISHPRESS_MULTIPLE_AUTHORS_VERSION', PP_AUTHORS_VERSION);
}

View File

@@ -0,0 +1,76 @@
<?php
/**
* File responsible for defining basic general constants used by the plugin.
*
* @package MultipleAuthors
* @author PublishPress <help@publishpress.com>
* @copyright Copyright (C) 2018 PublishPress. All rights reserved.
* @license GPLv2 or later
* @since 1.0.0
*/
use PPVersionNotices\Module\MenuLink\Module;
defined('ABSPATH') or die('No direct script access allowed.');
if (!defined('PP_AUTHORS_LOADED')) {
require_once __DIR__ . '/defines.php';
if (file_exists(PP_AUTHORS_LIB_VENDOR_PATH . '/cmb2/cmb2/init.php')) {
require_once PP_AUTHORS_LIB_VENDOR_PATH . '/cmb2/cmb2/init.php';
}
if (PUBLISHPRESS_AUTHORS_LOAD_DEPRECATED_LEGACY_CODE) {
require_once PP_AUTHORS_BASE_PATH . 'deprecated.php';
}
require_once PP_AUTHORS_BASE_PATH . 'src/functions/template-tags.php';
require_once PP_AUTHORS_BASE_PATH . 'src/functions/amp.php';
if (is_admin() && !defined('PUBLISHPRESS_AUTHORS_SKIP_VERSION_NOTICES')) {
add_action(
'plublishpress_authors_loaded',
function () {
if (current_user_can('install_plugins')) {
add_filter(
\PPVersionNotices\Module\TopNotice\Module::SETTINGS_FILTER,
function ($settings) {
$settings['publishpress-authors'] = [
'message' => esc_html__("You're using PublishPress Authors Free. The Pro version has more features and support. %sUpgrade to Pro%s", 'publishpress-authors'),
'link' => 'https://publishpress.com/links/authors-banner',
'screens' => [
['base' => 'edit-tags', 'id' => 'edit-author', 'taxonomy' => 'author'],
['base' => 'term', 'id' => 'edit-author', 'taxonomy' => 'author'],
['base' => 'edit', 'id' => 'edit-ppma_boxes', 'post_type' => 'ppma_boxes'],
['base' => 'post', 'id' => 'ppma_boxes', 'post_type' => 'ppma_boxes'],
['base' => 'edit', 'id' => 'edit-ppmacf_field', 'post_type' => 'ppmacf_field'],
['base' => 'post', 'id' => 'ppmacf_field', 'post_type' => 'ppmacf_field'],
['base' => 'authors_page_ppma-modules-settings', 'id' => 'authors_page_ppma-modules-settings'],
['base' => 'authors_page_ppma-author-list', 'id' => 'authors_page_ppma-author-list'],
['base' => 'authors_page_ppma-author-pages', 'id' => 'authors_page_ppma-author-pages'],
]
];
return $settings;
}
);
add_filter(
Module::SETTINGS_FILTER,
function ($settings) {
$settings['publishpress-authors'] = [
'parent' => 'ppma-authors',
'label' => __( 'Upgrade to Pro', 'publishpress-authors' ),
'link' => 'https://publishpress.com/links/authors-menu',
];
return $settings;
}
);
}
}
);
}
require_once PP_AUTHORS_MODULES_PATH . 'multiple-authors/multiple-authors.php';
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
<?php
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitPPAuthors::getLoader();

View File

@@ -0,0 +1,181 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="CMB2 Coding Standards for PHP" namespace="CMB2\CMB2\PHPCS\Standard">
<description>The coding standard for CMB2.</description>
<rule ref="PHPCompatibility" />
<config name="testVersion" value="7.3-" />
<file>.</file>
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>themes/omappv4/src/View/*</exclude-pattern>
<rule ref="WordPress-Core">
<!-- Allow with or without semicolons. -->
<exclude name="Squiz.PHP.EmbeddedPhp.NoSemicolon" />
<!-- Exclude other conflicting rules. -->
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_trigger_error" />
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="WordPress.Security.EscapeOutput" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict" />
<exclude name="WordPress.PHP.StrictComparisons.LooseComparison" />
<exclude name="WordPress.Arrays.CommaAfterArrayItem.NoComma" />
<exclude name="WordPress.NamingConventions.ValidVariableName" />
<exclude name="WordPress.NamingConventions.ValidFunctionName" />
<exclude name="WordPress.PHP.DisallowShortTernary.Found" />
</rule>
<!-- Prefer alignment over line length. -->
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<property name="maxColumn" value="1000" />
</properties>
</rule>
<rule ref="WordPress.DB.SlowDBQuery" />
<!-- Allow . in hook names. -->
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="." />
</properties>
</rule>
<rule ref="WordPress.Security.PluginMenuSlug" />
<rule ref="WordPress.Security.PluginMenuSlug.Using__FILE__">
<type>error</type>
</rule>
<!-- Disallow functions where WordPress has an alternative. -->
<rule ref="WordPress.WP.AlternativeFunctions">
<!-- ...but, allow some back in. -->
<properties>
<property name="exclude" type="array">
<element value="file_get_contents" />
<element value="file_system_read" />
<element value="json_encode" />
<element value="json_decode" />
<!-- wp_parse_url() only exists for inconsistency in PHP <5.4 -->
<element value="parse_url" />
</property>
</properties>
</rule>
<rule ref="WordPress.WP.CronInterval" />
<rule ref="WordPress.WP.CronInterval.CronSchedulesInterval">
<type>error</type>
<message>Scheduling crons at %s sec ( less than %s minutes ) is prohibited.</message>
</rule>
<rule ref="WordPress.WP.PostsPerPage" />
<rule ref="WordPress.WP.PostsPerPage.posts_per_page_numberposts">
<type>error</type>
</rule>
<rule ref="WordPress.WP.PostsPerPage.posts_per_page_posts_per_page">
<type>error</type>
</rule>
<!-- Disallow changing PHP's timezone. -->
<rule ref="WordPress.DateTime.RestrictedFunctions">
<properties>
<!-- Allow other datetime functions, just not timezone. -->
<property name="exclude" type="array">
<element value="date" />
</property>
</properties>
</rule>
<!--
Restore the ability to have multiple arguments per line
WPCS disallowed this behavior in 1.1.0, but we'd like to keep it until
there is a reason to disallow multiple arguments.
Ref: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/commit/bb8a48671e213a5588a6439ea52411eeefab4b0f
-->
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="allowMultipleArguments" value="true"/>
</properties>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<severity>0</severity>
</rule>
<!--
HM Rules / HM RULEZZZZ
https://engineering.hmn.md/how-we-work/style/php/
-->
<!-- Disallow long array syntax. fig-r/psr2r-sniffer -->
<rule ref="Generic.Arrays.DisallowShortArraySyntax" />
<!-- Single statement on same line. fig-r/psr2r-sniffer -->
<rule ref="Generic.Formatting.DisallowMultipleStatements" />
<!-- Namespacing required for classes. fig-r/psr2r-sniffer -->
<rule ref="PSR1.Classes.ClassDeclaration" />
<!-- Declare symbols or run code, but not both. fig-r/psr2r-sniffer -->
<rule ref="PSR1.Files.SideEffects" />
<!-- Namespacing required for functions. fig-r/psr2r-sniffer -->
<rule ref="PSR2.Namespaces.NamespaceDeclaration" />
<!-- Namespacing of `use` statements. fig-r/psr2r-sniffer -->
<rule ref="PSR2.Namespaces.UseDeclaration">
<exclude name="PSR2.Namespaces.UseDeclaration.MultipleDeclarations" />
</rule>
<!--- fig-r/psr2r-sniffer -->
<rule ref="PSR2R.Namespaces.UnusedUseStatement" />
<rule ref="PSR2R.Namespaces.UseInAlphabeticalOrder" />
<!-- Ban inline assignment in control structures (see note on Yoda Conditions above). fig-r/psr2r-sniffer -->
<rule ref="PSR2R.ControlStructures.NoInlineAssignment" />
<!--
Disregard WP's class file name rules which says:
"Class file names should be based on the class name with class-
prepended and the underscores in the class name replaced with hyphens."
-->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false" />
</properties>
</rule>
<!--
Forces a new line at the end of file rule (and others).
-->
<rule ref="Generic.Files">
<exclude name="Generic.Files.EndFileNoNewline" />
<exclude name="Generic.Files.LowercasedFilename.NotFound" />
<exclude name="Generic.Files.InlineHTML.Found" />
</rule>
<!--
Warn about lines longer than 200 chars,
and error for lines longer than 200 chars.
-->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="200" />
<property name="absoluteLineLimit" value="200" />
</properties>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration">
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
</rule>
<rule ref="VariableAnalysis"/>
</ruleset>

View File

@@ -0,0 +1,903 @@
# Changelog
All notable changes to this project will be documented in this file.
## Unreleased
*
## [2.11.0 - 2024-04-02](https://github.com/CMB2/CMB2/releases/tag/v2.11.0)
* Officially moved to PHP 7.4+ support!
### Enhancements
* Package updates.
* Update WordPress Tested up to tag 6.1. Props [@RubenMartins](https://github.com/RubenMartins) ([#1477](https://github.com/CMB2/CMB2/pull/1477)).
* Add filters for setting `object_id` and `mb_object_type` and in `do_scripts` - Allows overriding by plugins/libs. (Added to support the new [CMB2 WooCommerce HPOS Orders](https://github.com/CMB2/cmb2-woocommerce-hpos-orders) extension)
* Added a `cmb2_init_hooks` hook when hookup is called.
* Addressed some security concerns with the unserialization process for the stored serialized `DateTime` field values (`text_datetime_timestamp_timezone` field type only). ([#1510](https://github.com/CMB2/CMB2/pull/1510))
* [Development] Some build script improvements.
* [Development] Added some PHPCS/WPCS config.
* [Development] Added a phpcompatibility action. Props [@jazzsequence](https://github.com/jazzsequence) ([#1499](https://github.com/CMB2/CMB2/pull/1499), [#1500](https://github.com/CMB2/CMB2/pull/1500)).
### Bug Fixes
* Fix some line-height issues with dashicon buttons. Fixes [#1443](
* Fix issue where image can be attached to wrong group after removing previous group. ([#1473](https://github.com/CMB2/CMB2/pull/1473))
* Fixes issue where Select/Deselect all does not trigger change JS DOM events. Fixes [#1504](https://github.com/CMB2/CMB2/issues/1504).
## [2.10.1 - 2022-02-22](https://github.com/CMB2/CMB2/releases/tag/v2.10.1)
### Bug Fixes
* Fix issue with date picker formatting. Fixes [#1448](https://github.com/CMB2/CMB2/issues/1448).
## [2.10.0 - 2022-02-15](https://github.com/CMB2/CMB2/releases/tag/v2.10.0)
### Enhancements
* Sanitize URLs, defaulting to `https`. Props [@paulschreiber](https://github.com/paulschreiber) ([#1413](https://github.com/CMB2/CMB2/pull/1413)).
* Establish Cypress E2E Testing. Props [@markjaquith](https://github.com/markjaquith) ([#1437](https://github.com/CMB2/CMB2/pull/1437)).
* Updated the JS `shiftRows` functionality to be simpler, and fix issues with JS initialization. Fixes [#1426](https://github.com/CMB2/CMB2/issues/1426) and [#1431](https://github.com/CMB2/CMB2/issues/1431).
* Updated various NPM dependencies for security issues.
### Bug Fixes
* Update to prevent deprecation notice:`Required parameter $i follows optional parameter $args...`. Props [@carloswph](https://github.com/carloswph) ([#1417](https://github.com/CMB2/CMB2/pull/1417)).
* Make each date field more resilient to various date/timestamp values passed in (from REST API).
## [2.9.0 - 2021-03-21](https://github.com/CMB2/CMB2/releases/tag/v2.9.0)
### Enhancements
* Added `cmb2_tab_group_tabs` filter for adding arbitrary menu page urls to the cmb2 tabs, and move tab markup output to separate method, `CMB2_Options_Hookup::options_page_tab_nav_output()`. Fixes [#1407](https://github.com/CMB2/CMB2/issues/1407).
* Limit use of italic, including removing from field descriptions. Fixes [#1404](https://github.com/CMB2/CMB2/issues/1404).
* Add to list of valid image types from `get_allowed_mime_types()`, which makes SVGs more reliable when using the [Safe SVG](https://wordpress.org/plugins/safe-svg/) plugin. Fixes [#1223](https://github.com/CMB2/CMB2/issues/1223).
### Bug Fixes
* Fixes PHP warnings on repeatable ColorPicker with an array as default. Props [@rubengc](https://github.com/rubengc) ([#1340](https://github.com/CMB2/CMB2/pull/1340)).
* Address PHP 7.4, compatibility issues with `func_get_args()`. Fixes [#1389](https://github.com/CMB2/CMB2/issues/1389).
* Better generated array key for cached fields, fixes issue where wrong field is found. Fixes [#14053](https://github.com/CMB2/CMB2/issues/14053).
* Fix issue with options-pages being changed to register on a hook priority of `5` instead of the default `10`, causing some back-compatibility issues. Fixes [#1410](https://github.com/CMB2/CMB2/issues/1410).
## [2.8.0 - 2021-01-21](https://github.com/CMB2/CMB2/releases/tag/v2.8.0)
### Enhancements
* Added [CODE_OF_CONDUCT.md](https://github.com/CMB2/CMB2/blob/develop/CODE_OF_CONDUCT.md) file to meet GitHub Community standards. Props [@RubenMartins](https://github.com/RubenMartins) ([#1331](https://github.com/CMB2/CMB2/pull/1331)).
* Add ability to define the page-registration admin menu hook priority for options pages. Fixes [#1380](https://github.com/CMB2/CMB2/issues/1380).
### Bug Fixes
* Ensure `enqueue wp-color-picker` is enqueued for color fields. Props [@rubengc](https://github.com/rubengc) ([#1339](https://github.com/CMB2/CMB2/pull/1339)).
* Fix empty name/id attributes on `'file_list'` buttons. Props [@pgroot91](https://github.com/pgroot91) ([#1347](https://github.com/CMB2/CMB2/pull/1347)).
* Fix `wysiwyg` field type not working in a group, by ensuring scripts properly enqueued. Props [@yoren](https://github.com/yoren) ([#1361](https://github.com/CMB2/CMB2/pull/1361)).
* Fix `$object_id` doc block types in helper-functions.php. Fixes [#1365](https://github.com/CMB2/CMB2/issues/1365).
* Fix Metabox toggles visually broken with WP 5.5.x. Fixes [#1382](https://github.com/CMB2/CMB2/issues/1382).
* Fix `PHP Deprecated: Required parameter $field_id follows optional parameter $type`, due to changes in PHP 8.0. Fixes [#1396](https://github.com/CMB2/CMB2/issues/1396).
* Fix PHP notice caused by `deprecated_param` method in PHP 7.4. Props [@jonathanstegall](https://github.com/jonathanstegall) ([#1400](https://github.com/CMB2/CMB2/pull/1400)).
## [2.7.0 - 2020-01-21](https://github.com/CMB2/CMB2/releases/tag/v2.7.0)
### Enhancements
* Added support for sortable columns by default, with ability to disable with `'column' => array( 'disable_sortable' => true )`. Props [@RubenMartins](https://github.com/RubenMartins) ([#1281](https://github.com/CMB2/CMB2/pull/1281)).
* New field type, `'taxonomy_select_hierarchical'`. Fixes [#751](https://github.com/CMB2/CMB2/issues/751)
* New `text`, `textarea` and `wysiwyg` character counter options. For now, this feature is not available to `wysiwyg` field types within repeatable groups. Props [@gyrus](https://github.com/gyrus) ([#1276](https://github.com/CMB2/CMB2/pull/1276)).
- The new parameters:
- `'char_counter'` - Defaults to false, no counter. Set to true, or `words` to count words instead of characters.
- `'char_max'` - integer. When defined, counter shows remaining characters/words.
- `'char_max_enforce'` - boolean, default: false. Currently only applied (as maxlength attribute) to `text` and `textarea` fields which use `'characters'` for counter.
- You can also [override the default text strings](https://github.com/CMB2/CMB2/wiki/Field-Parameters#text) associated with these parameters:
- `'words_left_text'` - Default: "Words left"
- `'words_text'` - Default: "Words"
- `'characters_left_text'` - Default: "Characters left"
- `'characters_text'` - Default: "Characters"
- `'characters_truncated_text'` - Default: "Your text may be truncated."
* Update styling to be more compatible with WordPress 5.3. Props [@galengidman](https://github.com/galengidman) ([#1314](https://github.com/CMB2/CMB2/pull/1314))
* Add a new box parameter, `register_rest_field_cb`, which when used allows overriding the way CMB2 handles the `register_rest_field` callbacks, and defining your own REST prefix for your fields. See [this PR comment](https://github.com/CMB2/CMB2/pull/1240#issuecomment-552548488) for more context.
* Cleanup by renaming `CMB2_hookup` to `CMB2_Hookup`. Classes are case-insensitive, so this is a backwards-compatible change. Props [@szepeviktor](https://github.com/szepeviktor) ([#1330](https://github.com/CMB2/CMB2/pull/1330), [#1328](https://github.com/CMB2/CMB2/issues/1328)).
* Validate composer.json for Travis CI. Props [@szepeviktor](https://github.com/szepeviktor) ([#1326](https://github.com/CMB2/CMB2/pull/1326)).
* Added [LICENSE](https://github.com/CMB2/CMB2/blob/develop/LICENSE) file to meet GitHub Community standards. Props [@RubenMartins](https://github.com/RubenMartins) ([#1316](https://github.com/CMB2/CMB2/pull/1316)).
* Add new `"cmb2_display_class_{$fieldtype}"` filter and `'display_class'` field parameter to allow specifying the class to use to display the field (in admin columns, etc).
* Update `CMB2_Types::_id()` to allow not appending the iterator attribute if a repeatable field.
* Added `CMB2_Utils::concat_attrs()` test for nested arrays as data attributes.
* Various updates per [VIP feedback](https://github.com/CMB2/CMB2/issues/1260). Props [@kevinlangleyjr](https://github.com/kevinlangleyjr), [@mikeselander](https://github.com/mikeselander) ([#1255](https://github.com/CMB2/CMB2/pull/1255), [#1257](https://github.com/CMB2/CMB2/pull/1257), [#1259](https://github.com/CMB2/CMB2/pull/1259), [#1261](https://github.com/CMB2/CMB2/pull/1261) [#1262](https://github.com/CMB2/CMB2/pull/1262), and various direct commits. See [#1260](https://github.com/CMB2/CMB2/issues/1260)).
### Bug Fixes
* Fix some issues with Travis. Props [@anhskohbo](https://github.com/anhskohbo) ([#1220](https://github.com/CMB2/CMB2/pull/1220)).
* Javascript: Correctly pass the newly created row to the `cmb2_add_row` triggered event.
* Various code-formatting and code documentation improvements. Props [@tw2113](https://github.com/tw2113).
* Don't exclude composer.json from the distribution. Props [@johnbillion](https://github.com/johnbillion) ([#1225](https://github.com/CMB2/CMB2/pull/1225)).
* Ignore some more directories in the distribution package. Props [@johnbillion](https://github.com/johnbillion) ([#1226](https://github.com/CMB2/CMB2/pull/1226)).
* Use `CMB2_Field::get_rest_value()` to get values for fields in the post REST API endpoints ([#1284](https://github.com/CMB2/CMB2/issues/1284)).
* Fix issue where oEmbed fields' live-preview would not work if the field was added within a group, along with some other similarly related issues. Fixes [#1157](https://github.com/CMB2/CMB2/issues/1157).
* Fix issue when using REST API for `file` and `text_datetime_timestamp_timezone` field types, the supporting field data was not provided (e.g. the file id for `file` field, and the `utc` value for the `text_datetime_timestamp_timezone` field). Fixes [https://wordpress.org/support/topic/cmb2-rest-api-image-file-field-as-an-object/](https://wordpress.org/support/topic/cmb2-rest-api-image-file-field-as-an-object/).
* Escaping Improvements to File Base and File Fields. Props [@tomjn](https://github.com/tomjn) ([#1296](https://github.com/CMB2/CMB2/pull/1296), [#1297](https://github.com/CMB2/CMB2/pull/1297)).
* Fix issue where repeatable CodeMirror textareas could not be clicked/draggged to highlight text. Props [@JPry](https://github.com/JPry) ([#1300](https://github.com/CMB2/CMB2/pull/1300)).
* `taxonomy_select_hierarchical` now saves to the correct location, the term relationships table. Props [@latheva](https://github.com/latheva) ([#1307](https://github.com/CMB2/CMB2/pull/1307)).
* Fix issue ([#1158](https://github.com/CMB2/CMB2/issues/1158)) where default REST API endpoints (e.g. `/wp/v2/{post_type}`) would show all boxes for all custom post types even though not registered to the post-type. Props [@Mte90](https://github.com/Mte90) ([#1238](https://github.com/CMB2/CMB2/pull/1238)).
* Update and cull npm dependencis. Fixes [#1308](https://github.com/CMB2/CMB2/issues/1308).
* Fix some jshint issues.
* Updated the WordPress embeds URL references.
* Updates to account for WordPress 5.2 oEmbed changes.
* Fix to ensure date picker fields can have a default value. Fixes [#1245](https://github.com/CMB2/CMB2/issues/1245).
* Added `function_exists( 'add_action' )` check to bootstrap file to ensure compatibility with composer usage. Props [@salcode](https://github.com/salcode) ([#1271](https://github.com/CMB2/CMB2/pull/1271), [#1270](https://github.com/CMB2/CMB2/issues/1270))
* Corrected link to facetwp-cmb2 in README.md. Props [@marcelreschke](https://github.com/marcelreschke) ([#1248](https://github.com/CMB2/CMB2/pull/1248)).
* Use `get_user_locale()` in admin area instead of `get_locale()`. Fixes [#1267](https://github.com/CMB2/CMB2/issues/1267).
* `CMB2::is_box_type()` now also checks for taxonomies if box is registered to "term" object type. This should fix some issues where CMB2 term meta was not showing up in REST API requests to the term endpoints.
## [2.6.0 - 2019-01-18](https://github.com/CMB2/CMB2/releases/tag/v2.6.0)
### Enhancements
* Updated PHPUnit version in composer.json. Props [@slaFFik](https://github.com/slaFFik) ([#1204](https://github.com/CMB2/CMB2/pull/1204)).
* Package.json: fix the need of global (old) grunt. Props [@slaFFik](https://github.com/slaFFik) ([#1206](https://github.com/CMB2/CMB2/pull/1206)).
* Add optional confirmation dialog to group field's Remove button. Example [documented in the example functions file](https://github.com/CMB2/CMB2/blob/12036e2dcdeb5b019e844b814eca154bb0eee791/example-functions.php#L525). Props [@slaFFik](https://github.com/slaFFik) ([#1208](https://github.com/CMB2/CMB2/pull/1208)).
* Add 'id' attribute on group field `.postbox` divs to ensure compatibility with scripts which expect ids there. Props [@amans2k](https://github.com/amans2k) ([#1108](https://github.com/CMB2/CMB2/pull/1108)).
* Make `CMB2_Option` properties accessible. ([#1052](https://github.com/CMB2/CMB2/issues/1052))
* New Before/After row hooks: `'cmb2_before_field_row'`, `"cmb2_before_{$field_type}_field_row"`, `"cmb2_after_{$field_type}_field_row"`, `'cmb2_after_field_row'`. Props [@rubengc](https://github.com/rubengc) ([#953](https://github.com/CMB2/CMB2/pull/953)).
* Introduce three new filters to filter field arguments: `'cmb2_field_defaults'`, `'cmb2_field_arguments_raw'`, `'cmb2_field_arguments'`. Props [@jrfnl](https://github.com/jrfnl) ([#588](https://github.com/CMB2/CMB2/pull/588)).
### Bug Fixes
* Remove superfluous method definitions. Props [@tnorthcutt](https://github.com/tnorthcutt) ([#1200](https://github.com/CMB2/CMB2/pull/1200)).
* Fix `rest_value_cb` registering of filter. Props [@lipemat](https://github.com/lipemat) ([#1212](https://github.com/CMB2/CMB2/pull/1212)).
* Do not trigger tinyMCE editor save for the activeEditor. Prevents cursor jump in Gutenberg. Fixes [#1202](https://github.com/CMB2/CMB2/issues/1202)
* Fix issue where making a field repeatable would generate a Javascript error because of missing sortable library. Props [@slaFFik](https://github.com/slaFFik) ([#1216](https://github.com/CMB2/CMB2/pull/1216)).
* Ensure value passed to `CMB2_Utils::filter_empty` from `CMB2::save_group_field` is always an array. ([#1026](https://github.com/CMB2/CMB2/issues/1026))
* Fix potential issue with test path location. Props [@quasel](https://github.com/quasel) ([#463](https://github.com/CMB2/CMB2/pull/463)).
## [2.5.1 - 2018-12-10](https://github.com/CMB2/CMB2/releases/tag/v2.5.1)
### Bug Fixes
* Fix issue when the `core/editor` object does not exist (is undefined), causing incompatibility issues with Yoast and likely others. Fixes [#1197](https://github.com/CMB2/CMB2/issues/1197)
## [2.5.0 - 2018-12-08](https://github.com/CMB2/CMB2/releases/tag/v2.5.0)
### Enhancements
* Repeatable fields are now drag-sortable. Props [@lipemat](https://github.com/lipemat) ([#1142](https://github.com/CMB2/CMB2/pull/1142)).
* Update the `sv_SE` translation. Props [@edvind](https://github.com/edvind) ([#370](https://github.com/CMB2/CMB2/pull/370)).
* QA/PHPCS cleanup. Props [@tw2113](https://github.com/tw2113) ([#1179](https://github.com/CMB2/CMB2/pull/1179)).
* Add optional `'mb_callback_args'` CMB2 box property which allows defining the `$callback_args` passed into `add_meta_box()`. This allows using defining the new [Gutenberg/block-editor compatibility parameters](https://wordpress.org/gutenberg/handbook/extensibility/meta-box/). Fixes [#1191](https://github.com/CMB2/CMB2/issues/1191)
* Support any type of markup when customizing repeating group row. Props [@lipemat](https://github.com/lipemat) ([#1187](https://github.com/CMB2/CMB2/pull/1187)).
* Add `cmb_init_pickers` and `cmb_init_code_editors` Javascript events for allowing just-in-time configuration for pickers/editors.
* Fix field descriptions color contrast ratio for better accessibility. h/t [@rianrietveld](https://github.com/rianrietveld). Fixes [#1193](https://github.com/CMB2/CMB2/issues/1193).
* Add `CMB2_Field::get_rest_value()` method for sending value through several filters (`'cmb2_get_rest_value'`, `"cmb2_get_rest_value_{$field_type}"`, `"cmb2_get_rest_value_for_{$field_id}"` ) before sending to REST request.
### Bug Fixes
* Fix the options page errors when using CMB2 in WordPress prior to 4.7. Props [@manzoorwanijk](https://github.com/manzoorwanijk) ([#1166](https://github.com/CMB2/CMB2/pull/1166)).
* Fix occasonal fatal errors that can occur by using callback functions directly vs `call_user_func`. Props [@manzoorwanijk](https://github.com/manzoorwanijk) ([#1177](https://github.com/CMB2/CMB2/pull/1177)).
* Fix issue where `wysiwyg` fields' visual tab wouldn't save content on Gutenberg/block-editor posts. Props [@staurand](https://github.com/staurand) ([#1190](https://github.com/CMB2/CMB2/pull/1190) fixes [#1156](https://github.com/CMB2/CMB2/issues/1156)).
* Fix issue when `remove_default` wouldn't actually remove the default taxonomy metabox when box registration used an alternate box context. Props [@lipemat](https://github.com/lipemat) ([#1147](https://github.com/CMB2/CMB2/pull/1147)).
## [2.4.2 - 2018-05-25](https://github.com/CMB2/CMB2/releases/tag/v2.4.2)
### Bug Fixes
* Do not enqueue/register WordPress code editor JS if there are no `textarea_code` fields registered on the page. Fixes [#1110](https://github.com/CMB2/CMB2/issues/1110).
* Do not set repeated `wysiwyg` field values to string "false" when boolean false. Fixes [#1138](https://github.com/CMB2/CMB2/issues/1138) (again!).
## [2.4.1 - 2018-05-25](https://github.com/CMB2/CMB2/releases/tag/v2.4.1)
### Bug Fixes
* Do not set repeated field values to string "false" when boolean false. Fixes [#1138](https://github.com/CMB2/CMB2/issues/1138).
## [2.4.0 - 2018-05-24](https://github.com/CMB2/CMB2/releases/tag/v2.4.0)
### Enhancements
* Enable linking options pages via tabbed-navigation. Will output tabbed navigation for options-pages which share the same `'tab_group'` CMB2 box property. [This snippet](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/options-pages-with-tabs-and-submenus.php) demonstrates how to create a top-level menu options page with multiple submenu pages, each with the tabbed navigation. To specify a different tab title than the options-page title, set the `'tab_title'` CMB2 box property. See [#301](https://github.com/CMB2/CMB2/issues/301), [#627](https://github.com/CMB2/CMB2/issues/627).
* Complete the `zh-CN` translation. Props [@uicestone](https://github.com/uicestone) ([#1089](https://github.com/CMB2/CMB2/pull/1089)).
* Update the `nl_NL` translation. Props [@tammohaannl](https://github.com/tammohaannl) ([#1101](https://github.com/CMB2/CMB2/pull/1101)).
* Better display for white over transparent images (e.g. logos) by using a checkered background for images. ([#1103](https://github.com/CMB2/CMB2/issues/1103))
* Ability to disable the options [autoload parameter](https://codex.wordpress.org/Function_Reference/add_option#Parameters) via filter (`"cmb2_should_autoload_{$options_key}"`) or via a box parameter for `'options-page'` box registrations (`'autoload' => false,`). ([#1093](https://github.com/CMB2/CMB2/issues/1093))
* `'textarea_code'` field type now uses CodeMirror that is [used by WordPress](https://make.wordpress.org/core/2017/10/22/code-editing-improvements-in-wordpress-4-9/) ([#1096](https://github.com/CMB2/CMB2/issues/1096)). A field can opt-out to return to the previous behavior by specifying an `'options'` parameter:
`'options' => array( 'disable_codemirror' => true )`
As with the other javascript-enabled fields, the code-editor defaults can be overridden via a `data-codeeditor` attribute. E.g:
```php
'attributes' => array(
'data-codeeditor' => json_encode( array(
'codemirror' => array(
'mode' => 'css',
),
) ),
),
```
* Improve/add comment info banners at top of CMB2 CSS files.
* Added `resetBoxes`/`resetBox` Javascript methods for resetting CMB2 box forms.
* Improved styles for fields in the new-term form.
* New `CMB2_Boxes` methods for filtering instances of `CMB2`, `CMB2_Boxes::get_by( $property, $optional_compare )` and `CMB2_Boxes::filter_by( $property, $to_ignore = null )`.
### Bug Fixes
* Fix the `'taxonomy_*'` fields when used for term fields/meta. Save the value to term-meta.
* Clear the CMB2 fields when a term is added. Fixes [#794](https://github.com/CMB2/CMB2/issues/794).
* Repeated fields now use registered field defaults for values. Fixes [#1137](https://github.com/CMB2/CMB2/issues/1137).
* Fixed the formatting for deprecated messages in the log.
* Prevent opening of media modal when clicking the file "Download" link. Fixes [#1130](https://github.com/CMB2/CMB2/issues/1130).
## [2.3.0 - 2017-12-20](https://github.com/CMB2/CMB2/releases/tag/v2.3.0)
### Enhancements
* Updated Italian translation. Props [@Mte90](https://github.com/Mte90) ([#1067](https://github.com/CMB2/CMB2/issues/1067)).
* Starting with this release, we are fully switching to the more communicative and standard [Semantic Versioning](https://semver.org/). ([#1061](https://github.com/CMB2/CMB2/issues/1061)).
### Bug Fixes
* Update for compatibility with PHP 7.2 (e.g. fixes `Fatal error: Declaration of CMB2_Type_Colorpicker::render() must be compatible with CMB2_Type_Text::render($args = Array)...`). ([#1070](https://github.com/CMB2/CMB2/issues/1070), [#1074](https://github.com/CMB2/CMB2/issues/1074), [#1075](https://github.com/CMB2/CMB2/issues/1075)).
## [2.2.6.2 - 2017-11-24](https://github.com/CMB2/CMB2/releases/tag/v2.2.6.2)
### Bug Fixes
* Fix another issue (introduced in 2.2.6) with repeatable fields not being able to save additional fields. Props [@anhskohbo](https://github.com/anhskohbo) ([#1059](https://github.com/CMB2/CMB2/pull/1059), [#1058](https://github.com/CMB2/CMB2/issues/1058)).
* Only dequeue `jw-cmb2-rgba-picker-js` script (and enqueue our `wp-color-picker-alpha`) if it is actually found.
## [2.2.6.1 - 2017-11-24](https://github.com/CMB2/CMB2/releases/tag/v2.2.6.1)
### Enhancements
* Merge in the [CMB2 RGBa Colorpicker](https://github.com/JayWood/CMB2_RGBa_Picker) field type functionality to the CMB2 colopicker field type. Adds the ability to add an alpha (transparency) slider to the colorpicker by adding the `'alpha'` option [to the field options array](https://github.com/CMB2/CMB2/blob/6fce2e7ba8f41345a23bc2064e30433bdb11c16c/example-functions.php#L263-L265). Thank you to [JayWood](https://github.com/JayWood) for his work on his custom field type.
### Bug Fixes
* Fix issue (introduced in 2.2.6) with complex fields set as repeatable not being able to save additional fields. Fixes [#1054](https://github.com/CMB2/CMB2/issues/1054).
## [2.2.6 - 2017-11-14](https://github.com/CMB2/CMB2/releases/tag/v2.2.6)
### Enhancements
* Move the fetching of group label and description to _after_ calling `'before_group'` parameter.
* Allow using the `'render_row_cb'` param for group fields. Fixes [#1041](https://github.com/CMB2/CMB2/issues/1041).
* Allow resetting cached CMB2 field objects (new 3rd parameter to `CMB2::get_field()`).
* Allow resetting cached callback results (`CMB2_Base::unset_param_callback_cache()`).
* Persian translation provided by [@reza-irdev](https://github.com/reza-irdev) ([#1046](https://github.com/CMB2/CMB2/issues/1046)).
* Added a `'message_cb'` box property, which allows defining a custom callback for adding options-save messages on `options-page` boxes. An example has been added to [example-functions.php](https://github.com/CMB2/CMB2/commit/43d513c135e52c327bafa06309821c29323ae2dd#diff-378c74d0ffffc1759b8779a135476777).
* Updated many the oembed-related unit tests to more reliably test the relevant parts, and not so much the actual success of the WordPress functions.
* Updated travis config to Install PHP5.2/5.3 on trusty for unit tests. Stolen from [gutenberg/pull/2049](https://github.com/WordPress/gutenberg/pull/2049). Intended to compensate for Travis removing support for PHP 5.2/5.3.
### Bug Fixes
* Ensure `'file'` field type ID is removed from the database if the `'file'` field type's value is empty ([Support thread](https://wordpress.org/support/topic/bug-field-of-type-file-does-not-delete-postmeta-properly/)).
* Fix JS errors when `user_can_richedit()` is false ("Disable the visual editor when writing" user option is checked, or various unsupported browsers). See [#1031](https://github.com/CMB2/CMB2/pull/1031).
* Fix issue where some European date formats (e.g. `F j, Y`) would not properly translate into jQuery UI date formats. [Support thread](https://wordpress.org/support/topic/using-wordpresss-date-time-format-settings)
* Fix repeating fields within repeating groups having the values/indexes incorrectly associated. Props [@daggerhart](https://github.com/daggerhart) ([#1047](https://github.com/CMB2/CMB2/pull/1047)). Fixes [#1035](https://github.com/CMB2/CMB2/issues/1035), [#348](https://github.com/CMB2/CMB2/issues/348).
* Fixed multiple update messages on settings pages when CMB2 option pages were registered ([#1049](https://github.com/CMB2/CMB2/issues/1049)).
* Fix issue where using multiple oembed fields could cause incorrectly cached arguments to be used.
* Fix bug where `'select_all_button' => false` was not working for `'taxonomy_multicheck'` field type ([#1005](https://github.com/CMB2/CMB2/issues/1005)).
## [2.2.5.3 - 2017-08-22](https://github.com/CMB2/CMB2/releases/tag/v2.2.5.3)
### Enhancements
* Update to instead initate CMB2 hookup via `"cmb2_init_hookup_{$cmb_id}"` hook. Allows plugins to unhook/rehook/etc.
### Bug Fixes
* Spelling/Grammar fixes. Props [@garrett-eclipse](https://github.com/garrett-eclipse) ([#1012](https://github.com/CMB2/CMB2/pull/1012)).
* Fix "PHP Strict Standards: Static function should not be abstract" notice.
* Add `CMB2_Utils::normalize_if_numeric()` to address problems when using floats as select/radio values. Fixes [#869](https://github.com/CMB2/CMB2/issues/869). See [#1013](https://github.com/CMB2/CMB2/pull/1013).
* Fix issues with apostrophes in money values. (e.g. in Swiss German the thousand separator is an apostrophe). Props [@ocean90](https://github.com/ocean90) ([#1014](https://github.com/CMB2/CMB2/issues/1014), [#1015](https://github.com/CMB2/CMB2/pull/1015)).
* Provide public access to the `CMB2_Options_Hookup::$option_key` property.
* Change the updated-settings notice query variable so that WordPress does not auto-add settings notices on top of ours.
* For settings pages, only output settings errors if WordPress does not do it by default (for sub-pages of `options-general.php`), and if the errors are not disabled via the `'disable_settings_errors'` box property.
## [2.2.5.2 - 2017-08-08](https://github.com/CMB2/CMB2/releases/tag/v2.2.5.2)
### Bug Fixes
* Fix issue in 2.2.5 with non-sortable repeatable groups not having new groups values be emptied on creation/clone. [Support thread](https://wordpress.org/support/topic/the-default-parameter-dont-work-in-group-fields/page/2/)
* Fix issue in 2.2.5 with options pages not saving when `'parent_slug'` box property was used. Fixes [#1008](https://github.com/CMB2/CMB2/issues/1008).
## [2.2.5.1 - 2017-08-07](https://github.com/CMB2/CMB2/releases/tag/v2.2.5.1)
### Bug Fixes
* Fix issue in 2.2.5 which caused empty repeatable groups having the buttons set to have a disabled "Remove Group" button. [Support thread](https://wordpress.org/support/topic/the-default-parameter-dont-work-in-group-fields/)
## [2.2.5 - 2017-08-07](https://github.com/CMB2/CMB2/releases/tag/v2.2.5)
### Enhancements
* Options pages are now first-class CMB2 citizens, and registering a box to show on an options page will automatically register the menu page and output the form on the page. [See example](https://github.com/CMB2/CMB2/blob/v2.2.5/example-functions.php#L640-L683). (The [snippets](https://github.com/CMB2/CMB2-Snippet-Library/tree/master/options-and-settings-pages) in the snippet library will be updated to reflect this change)
* Improved Options Page styling. Props [@anhskohbo](https://github.com/anhskohbo) ([#1006](https://github.com/CMB2/CMB2/pull/1006)).
* Improved cohesive styles for repeatable fields. Props [@anhskohbo](https://github.com/anhskohbo) ([#819](https://github.com/CMB2/CMB2/pull/819)).
* New field types, `'taxonomy_radio_hierarchical'`, and `'taxonomy_multicheck_hierarchical'`, for displaying taxonomy options in a hierarchial layout. Props to [eriktelepovsky](https://github.com/eriktelepovsky) for the [working code](https://github.com/CMB2/CMB2/issues/640#issuecomment-246938690). ([#640](https://github.com/CMB2/CMB2/issues/640))
* Removing last repeat item row (and repeat group row) is now somewhat allowed in that the "remove" button simply resets the last item to empty. Fixes [#312](https://github.com/CMB2/CMB2/issues/312).
* Enable the additional media library modal filters. Fixes [#873](https://github.com/CMB2/CMB2/issues/873).
* Sanitize the attributes added via the `cmb2_group_wrap_attributes` filter.
* New field parameter, `'query_args'`, which can be used by the `'taxonomy_*'` fields. Provides ability to override the arguments passed to `get_terms()`.
* The `cmb2_can_save` filter now passes the CMB2 object as the 2nd parameter. Props [@Arno33](https://github.com/Arno33) ([#994](https://github.com/CMB2/CMB2/pull/994)).
* Update the file field type to work properly within a custom field context by allowing the passing of override arguments to `CMB2_Types::file()` method.
* Many WordPress Code Standards improvements/updates. Props [@bradp](https://github.com/bradp)
* Include absolute paths when including the core php files. Props [@anhskohbo](https://github.com/anhskohbo) ([#998](https://github.com/CMB2/CMB2/pull/998)).
* Change language throught to reflect CMB2's move to its own organization.
* Break `CMB2_Field:options()` method apart to allow re-setting options from field params. Related: [reaktivstudios/cmb2-flexible-content/pull/8](https://github.com/reaktivstudios/cmb2-flexible-content/pull/8).
* New `CMB2:box_types()` method for getting the array of registered `'object_types'` for a box. Ensures the return is an array.
* Improved inline hooks documentation.
* Updated several CMB2 methods to return the CMB2 object (for method chaining). Methods include:
* `CMB2::show_form()`
* `CMB2::render_form_open()`
* `CMB2::render_form_close()`
* `CMB2::render_group_row()`
* `CMB2::render_hidden_fields()`
* `CMB2::save_fields()`
* `CMB2::process_fields()`
* `CMB2::process_field()`
* `CMB2::pre_process()`
* `CMB2::after_save()`
* `CMB2::add_fields()`
### Bug Fixes
* Update for `file`/`file_list` fields to properly show a preview for SVG images. Fixes [#874](https://github.com/CMB2/CMB2/pull/874).
* Fix and standardize inconsistent button classes. Update all buttons to use the `.button-secondary` class instead of the `.button` class. This alleviates some front-end issues for themes which target the `.button` class. _This is a backwards-compatibility break._ If your theme or plugin targets the `.button` class within CMB2, you will need to update to use `.button-secondary`.
* Correct the before/after form hooks order. For more details see ([#954](https://github.com/CMB2/CMB2/pull/954)).
* Fix regression with custom fields not properly repeating. Props [@desrosj](https://github.com/desrosj) ([#969](https://github.com/CMB2/CMB2/pull/969)). Fixes [#901](https://github.com/CMB2/CMB2/issues/901).
* Fix "Illegal string offset" notices when `CMB2_Option` methods are called when the option value is empty, as well as additional unit tests for the `CMB2_Option` class. Props [@anhskohbo](https://github.com/anhskohbo) ([#993](https://github.com/CMB2/CMB2/pull/993)).
* Fix bug where select fields or checkbox fields occasionally would retain previous group's value when adding new groups. Fixes [#853](https://github.com/CMB2/CMB2/issues/853).
* Fix JS to prevent meta keys with `|` or `/` from breaking file fields. Props [@lipemat](https://github.com/lipemat) ([#1003](https://github.com/CMB2/CMB2/pull/1003)).
* Fix jQuery Migrate's `jQuery.fn.attr('value', val) no longer sets properties` warning.
* Fix issue with CMB2 being too aggressive with stripping slashes from values. Fixes [#981](https://github.com/CMB2/CMB2/issues/981).
## [2.2.4 - 2017-02-27](https://github.com/CMB2/CMB2/releases/tag/v2.2.4)
### Enhancements
* Modify `'taxonomy_*'` fields to return stored terms for non-post objects.
* Modify `CMB2::get_sanitized_values()` to return the sanitized `'taxonomy_*'` field values. Also added `"cmb2_return_taxonomy_values_{$cmb_id}"` filter to modify if `'taxonomy_*'` field values are returned. Fixes [#538](https://github.com/CMB2/CMB2/issues/538).
* Allow outputting CMB2 boxes/fields in additional locations in the post-editor.
**The new locations are:** [`form_top`](https://developer.wordpress.org/reference/hooks/edit_form_top/), [`before_permalink`](https://developer.wordpress.org/reference/hooks/edit_form_before_permalink/), [`after_title`](https://developer.wordpress.org/reference/hooks/edit_form_after_title/), and [`after_editor`](https://developer.wordpress.org/reference/hooks/edit_form_after_editor/)
These would be defined by setting the `context` property for your box:
```php
$cmb_demo = new_cmb2_box( array(
...
'context' => 'before_permalink',
) );
```
If it is preferred that the fields are output without the metabox, then omit the `'title'` property from the metabox registration array, and instead add ` 'remove_box_wrap' => true,`.
Props [@norcross](https://github.com/norcross) ([#836](https://github.com/CMB2/CMB2/pull/836)).
* New field parameter, `'render_class'`, allowing you to override the default `'CMB2_Type_Base'` class that is used when rendering the field. This provides interesting object-oriented ways to override default CMB2 behavior by subclassing the default class and overriding methods. The render class can also be overridden with the `"cmb2_render_class_{$fieldtype}"` filter, which is passed the default render class name as well as the `CMB2_Types` object, but this should be used sparingly, and within the context of your project's boxes/fields or you could break other plugins'/themes' CMB2 fields.
* Improvements to the `file`/`file_list` fields javascript APIs, including using undersore templates.
* Small improvements to the styling for the `file_list` field type.
* New action hook, `cmb2_footer_enqueue`, which occurs after CMB2 enqueues its assets.
* Example functions clean up. Props [@PavelK27](https://github.com/PavelK27) ([#866](https://github.com/CMB2/CMB2/pull/866)).
* New `CMB2_Utils` methods, `get_available_image_sizes()` and `get_named_size()`. Props [@Cai333](https://github.com/Cai333).
### Bug Fixes
* Fix datepicker month/year dropdown text color. On windows, the option text was showing as white (invisible). Fixes [#770](https://github.com/CMB2/CMB2/issues/770).
* Repeatable WYSIWYG no longer breaks if `'quicktags'` param is set to false. Props [@timburden](https://github.com/timburden) ([#797](https://github.com/CMB2/CMB2/pull/797), [#796](https://github.com/CMB2/CMB2/issues/796)).
* Do not process title fields during group field save process.
* Fix issue where term-meta values were not being displayed for some users. Props [@sbussetti](https://github.com/sbussetti) ([#763](https://github.com/CMB2/CMB2/pull/763), [#700](https://github.com/CMB2/CMB2/issues/700)).
* Fix issue where term meta would not be applied when using the new term form if multiple object types were specified. Props [@ADC07](https://github.com/ADC07) ([#842](https://github.com/CMB2/CMB2/pull/842), [#841](https://github.com/CMB2/CMB2/issues/841)).
* Fix WordPress spinner styling when boxes/fields used on the frontend.
* Fix issue where clicking to remove a `file_list` item could occasionally remove the field row. ([#828](https://github.com/CMB2/CMB2/pull/828)).
* Fix issue where empty file field in group would still cause non-empty values to store to database. ([#721](https://github.com/CMB2/CMB2/issues/721)).
* Make `file`/`file_list` field preview images work with named sizes. Props [@Cai333](https://github.com/Cai333) ([#848](https://github.com/CMB2/CMB2/pull/848), [#844](https://github.com/CMB2/CMB2/issues/844)).
* Fix incorrect text-domain. ([#798](https://github.com/CMB2/CMB2/issues/798))
* Do not silence notices/errors in `CMB2_Utils::get_file_ext()`.
* If `title` field type has no name value, then only output a span element (instead of a header element).
## [2.2.3.1 - 2016-11-08](https://github.com/CMB2/CMB2/releases/tag/v2.2.3.1)
### Enhancements
* Better styling for disabled group "X" buttons, and add title attr. Fixes [#773](https://github.com/CMB2/CMB2/issues/773).
### Bug Fixes
* Use quotes for `label[for=""]` selector. Fixed `Syntax error, unrecognized expression`. Props [@anhskohbo](https://github.com/anhskohbo) ([#789](https://github.com/CMB2/CMB2/pull/789)).
* Fix `ReferenceError: tinyMCE is not defined` javascript errors (happening when trying to remove a repeatable field/group). Fixes [#790](https://github.com/CMB2/CMB2/issues/790), and [#730](https://github.com/CMB2/CMB2/issues/730).
* Fix REST API `'show_in_rest'` examples in `example-functions.php`. Any REST API boxes/fields must use the `'cmb2_init'` hook (as opposed to the `'cmb2_admin_init'` hook).
## [2.2.3 - 2016-10-25](https://github.com/CMB2/CMB2/releases/tag/v2.2.3)
### Enhancements
* CMB2 REST API! CMB2 now has WP REST API endpoints for displaying your boxes and fields data, as well as registers rest fields in the existing post, user, term, and comment endpoints (in the cmb2 namespace). Enabling the REST API for your boxes/fields is opt-in, meaning it will not be automatically enabled. For more info, [check out the wiki](https://github.com/CMB2/CMB2/wiki/REST-API).
* Small string improvement, move a period inside the translatable string. Props [@pedro-mendonca](https://github.com/pedro-mendonca) ([#672](https://github.com/CMB2/CMB2/pull/672)).
* Introduce the `'save_field'` boolean field parameter for disabling the saving of a field. Useful if you want to display the value of another field, or use a disabled/read-only field. Props [@jamesgol](https://github.com/jamesgol) ([#674](https://github.com/CMB2/CMB2/pull/674), [#346](https://github.com/CMB2/CMB2/issues/346), [#500](https://github.com/CMB2/CMB2/issues/500)).
* Update docblocks for `CMB2_Field::save_field_from_data()` and `CMB2_Field::save_field()`. Props [@jamesgol](https://github.com/jamesgol) ([#675](https://github.com/CMB2/CMB2/pull/675)).
* More javascript events tied to the media modal actions (related to the `'file'` and '`file_list'` fields). `'cmb_media_modal_init'`, `'cmb_media_modal_open'`, and `'cmb_media_modal_select'`.
* All CMB2 JS events now also get the CMB2 JS object passed in the list of arguments.
* CMB2 JS object is now instantiated without stomping existing object, to enable extending.
* New field parameter for taxonomy fields, `'remove_default'` which allows disabling the default taxonomy metabox. Props [@c3mdigital](https://github.com/c3mdigital) ([#593](https://github.com/CMB2/CMB2/pull/593)).
* Change `'row_classes'` to just `'classes'`, to mirror the metabox `'classes'` property. Also now accepts a `'classes_cb'` parameter for specifying a callback which returns a string or array. The callback will receive `$field_args` as the first argument, and the CMB2_Field `$field` object as the second argument. (`'row_classes'` will continue to work, but is deprecated)
* Make wysiwyg editors work in the repeatable groups context. A standard repeatable (non-group) wysiwyg field is not supported (but will possibly be included in a future update). Props [@johnsonpaul1014](https://github.com/johnsonpaul1014) ([#26](https://github.com/CMB2/CMB2/pull/26), [#99](https://github.com/CMB2/CMB2/pull/99), [#260](https://github.com/CMB2/CMB2/pull/260), [#264](https://github.com/CMB2/CMB2/pull/264), [#356](https://github.com/CMB2/CMB2/pull/356), [#431](https://github.com/CMB2/CMB2/pull/431), [#462](https://github.com/CMB2/CMB2/pull/462), [#657](https://github.com/CMB2/CMB2/pull/657), [#693](https://github.com/CMB2/CMB2/pull/693)).
* Add an id to the heading tag in the title field. This allows linking to a particular title using the id.
* Internationalization improvements. Props [ramiy](https://github.com/ramiy) ([#696](https://github.com/CMB2/CMB2/pull/696)).
* Ensure that saving does not happen during a switch-to-blog session, as data would be saved to the wrong object. [See more](https://wordpress.org/support/topic/bug-in-lastest-version?replies=2).
* Add `'cmb2_group_wrap_attributes'` filter to modifying the group wrap div's attributes. Filter gets passed an array of attributes and expects the return to be an array. Props [jrfnl](https://github.com/jrfnl) ([#582](https://github.com/CMB2/CMB2/pull/582)).
* Update the unit-tests README and inline docs. Props [bobbingwide](https://github.com/bobbingwide) ([#714](https://github.com/CMB2/CMB2/pull/714), [#715](https://github.com/CMB2/CMB2/pull/715)).
* Minor update to make naming-conventions consistent. Props [ramiy](https://github.com/ramiy) ([#718](https://github.com/CMB2/CMB2/pull/718)).
* Update files to be compatible with PHP7 CodeSniffer standards. Props [ryanshoover](https://github.com/ryanshoover) ([#719](https://github.com/CMB2/CMB2/pull/719), [#720](https://github.com/CMB2/CMB2/pull/720)).
* Make exception message translatable. Props [ramiy](https://github.com/ramiy) ([#724](https://github.com/CMB2/CMB2/pull/724)).
* Portuguese translation provided by [@alvarogois](https://github.com/alvarogois) and [@pedro-mendonca](https://github.com/pedro-mendonca) - [#709](https://github.com/CMB2/CMB2/pull/709), [#727](https://github.com/CMB2/CMB2/pull/727).
* Stop using `$wp_version` global. Props [ramiy](https://github.com/ramiy) ([#731](https://github.com/CMB2/CMB2/pull/731)).
* Closures (anonymous functions) are now supported for any box/field `'*_cb'` parameters. E.g.
```php
...
'show_on_cb' => function( $cmb ) { return has_tag( 'cats', $cmb->object_id ); },
...
```
### Bug Fixes
* If custom field types use a method and the Type object has not been instantiated, Try to guess the Type object and instantiate.
* Normalize WordPress root path (`ABSPATH`) and theme rooth path (`get_theme_root()`). Props [@rianbotha](https://github.com/rianbotha) ([#677](https://github.com/CMB2/CMB2/pull/677), [#676](https://github.com/CMB2/CMB2/pull/676)).
* Fix issue with `'cmb2_remove_row'` Javascript callback for non-group row removal. Fixes [#729](https://github.com/CMB2/CMB2/pull/729)).
* Fix issue with missing assignment of variable (undefined variable). Props [@anhskohbo](https://github.com/anhskohbo) ([#779](https://github.com/CMB2/CMB2/pull/779)).
## 2.2.2.1 - 2016-06-27
### Bug Fixes
* Fix issue that kept CMB2 stylesheet from being enqueued when using the [options-page snippets](https://github.com/CMB2/CMB2-Snippet-Library/tree/master/options-and-settings-pages).
* Fix issue which caused the CMB2 column display styles to be enqueued in the wrong pages. Now only enqueues on admin pages with columns.
## 2.2.2 - 2016-06-27
### Enhancements
* You can now set admin post-listing columns with an extra field parameter, `'column' => true,`. If you want to dictate what position the column is, use `'column' => array( 'position' => 2 ),`. If you want to dictate the column title (instead of using the field `'name'` value), use `'column' => array( 'name' => 'My Column' ),`. If you need to specify the column display callback, set the `'display_cb'` parameter to [a callback function](https://github.com/CMB2/CMB2/wiki/Field-Parameters#render_row_cb). Columns work for post (all post-types), comment, user, and term object types.
* Updated Datepicker styles using JJJ's "jQuery UI Datepicker CSS for WordPress", so props Props [@stuttter](https://github.com/stuttter), [@johnjamesjacoby](https://github.com/johnjamesjacoby). Also cleaned up the timepicker styles (specifically the buttons) to more closely align with the datepicker and WordPress styles.
* CMB2 is now a lot more intelligent about where it is located in your installation. This update should solve almost all of the reasons to use the `'cmb2_meta_box_url'` filter (thought it will continue to work as expected). ([#27](https://github.com/CMB2/CMB2/issues/27), [#118](https://github.com/CMB2/CMB2/issues/118), [#432](https://github.com/CMB2/CMB2/issues/432), [related wiki item](https://github.com/CMB2/CMB2/wiki/Troubleshooting#cmb2-urls-issues))
* Implement CMB2_Ajax as a singleton. Props [jrfnl](https://github.com/jrfnl) ([#602](https://github.com/CMB2/CMB2/pull/602)).
* Add `classes` and `classes_cb` CMB2 box params which allows you to add additional classes to the cmb-wrap. The `classes` parameter can take a string or array, and the `classes_cb` takes a callback which returns a string or array. The callback will receive `$cmb` as an argument. These classes are also passed through a new filter, `'cmb2_wrap_classes'`, which receives the array of classes as the first argument, and the CMB2 object as the second. Reported/requested in [#364](https://github.com/CMB2/CMB2/issues/364#issuecomment-213223692).
* Make the `'title'` field type accept extra arguments. Props [@vladolaru](https://github.com/vladolaru), [@pixelgrade](https://github.com/pixelgrade) ([#656](https://github.com/CMB2/CMB2/pull/656)).
* Updated `cmb2_get_oembed()` function to NOT return the "remove" link, as it's intended for outputting the oembed only. **This is a backwards-compatibility concern.** If you were depending on the "remove" link, use `cmb2_ajax()->get_oembed( $args )` instead.
* New function, `cmb2_do_oembed()`', which is hooked to `'cmb2_do_oembed'`, so you can use `do_action( 'cmb2_do_oembed', $args )` in your themes without `function_exists()` checks.
* New method, `CMB2:set_prop( $property, $value )`, for setting a CMB2 metabox object property.
* The `CMB2_Field` object instances will now have a `cmb_id` property and a `get_cmb` method to enable access to the field's `CMB2` parent object's instance, in places like field callbacks and filters (e.g. `$cmb = $field->get_cmb();`).
* Add a `data-fieldtype` attribute to the field rows for simpler identification in Javascript.
* Moved each type in `CMB2_Types` to it's own class so that each field type can handle it's own field display, and added the infrastructure to maintainn back-compatibility.
* New `CMB2_Utils` methods, `notempty()` and `filter_empty()`, both of which consider `null`, `''` and `false` as empty, but allow `0` (for saving `0` as a field value).
* New `CMB2_Utils` public methods, `get_url_from_dir()`, `get_file_ext()`, `get_file_name_from_path()`, and `wp_at_least()`.
* Add a `cmb_pre_init` Javascript event to allow overriding CMB2 defaults via JS.
### Bug Fixes
* Fix issue with 'default' callback not being applied in all instances. Introduced new `CMB2_Field::get_default()` method, and `'default_cb'` field parameter. Using the `'default'` field parameter with a callback will be deprecated in the next few releases. ([#572](https://github.com/CMB2/CMB2/issues/572)).
* Be sure to call `CMB2_Field::row_classes()` for group field rows. Also, update CSS to use the "cmb-type-group" classname instead of "cmb-repeat-group-wrap".
* Introduce new `'text'` and `'text_cb'` field parameters for overriding CMB2 text strings instead of using the `'options'` array. ([#630](https://github.com/CMB2/CMB2/pull/630))
* Fix bug where the value of '0' could not be saved in group fields.
* Fix bug where a serialized empty array value in the database for a repeatable field would output as "Array".
* Allow for optional/empty money field. Props [@jrfnl](https://github.com/jrfnl) ([#577](https://github.com/CMB2/CMB2/pull/577)).
* The `CMB2::$updated` parameter (which contains field ids for all fields updated during a save) now also correctly adds group field ids to the array.
## 2.2.1 - 2016-02-29
### Bug Fixes
* Fixes back-compatibility issue which could allow multiple CMB2 instances to load (causing fatal errors). ([#520](https://github.com/CMB2/CMB2/pull/520))
## 2.2.0 - 2016-02-27
### Enhancements
* Term Meta! As of WordPress 4.4, [WordPress will have the ability to use term metadata](https://make.wordpress.org/core/2015/10/23/4-4-taxonomy-roundup/). CMB2 will work with term meta out of the box. To do so, see the example cmb registration in the `yourprefix_register_taxonomy_metabox` function in [example-functions.php](https://github.com/CMB2/CMB2/blob/master/example-functions.php).
* New hooks which hook in after save field action: `'cmb2_save_field'` and `"cmb2_save_field_{$field_id}"`. Props [wpsmith](https://github.com/wpsmith) ([#475](https://github.com/CMB2/CMB2/pull/475)).
* The "cmb2_sanitize_{$field_type}" hook now runs for every field type (not just custom types) so you can override the sanitization for all field types via a filter.
* `CMB2::show_form()` is now composed of 3 smaller methods, `CMB2::render_form_open()`, `CMB2::render_field()`, `CMB2::render_form_close()` ([#506](https://github.com/CMB2/CMB2/pull/506)).
* RTL Style generated. Props [@devinsays](https://github.com/devinsays) ([#510](https://github.com/CMB2/CMB2/pull/510)).
* Properly scope date/time-pickers styling by adding a class to only cmb2 picker instances. ([#527](https://github.com/CMB2/CMB2/pull/527))
* Allow per-field overrides for the date/time/color picker options (wiki documentation: [Modify Field Date, Time, or Color Picker options](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#modify-field-date-time-or-color-picker-options))
* Fix some inline documentation issues. Props [@jrfnl](https://github.com/jrfnl) ([#579](https://github.com/CMB2/CMB2/pull/579)).
* Include `.gitattributes` file for excluding development resources when using Composer. Props [@benoitchantre](https://github.com/benoitchantre) ([#575](https://github.com/CMB2/CMB2/pull/575), [#53](https://github.com/CMB2/CMB2/pull/53)).
### Bug Fixes
* Fixed issue with `'taxonomy_select'` field type where a term which evaluated falsey would not be displayed properly. Props [adamcapriola](https://github.com/adamcapriola) ([#477](https://github.com/CMB2/CMB2/pull/477)).
* Fix issue with colorpickers not changing when sorting groups.
* `'show_option_none'` field parameter now works on taxonomy fields when explicitly setting to false.
* Fix so the date/time-picker javascript respects the `'date_format'` and `'time_format'` field parameters. Props [@yivi](https://github.com/yivi) ([#39](https://github.com/CMB2/CMB2/pull/39), [#282](https://github.com/CMB2/CMB2/pull/282), [#300](https://github.com/CMB2/CMB2/pull/300), [#318](https://github.com/CMB2/CMB2/pull/318), [#330](https://github.com/CMB2/CMB2/pull/330), [#446](https://github.com/CMB2/CMB2/pull/446), [#498](https://github.com/CMB2/CMB2/pull/498)).
* Fix a sometimes-broken unit test. Props [JPry](https://github.com/JPry) ([#539](https://github.com/CMB2/CMB2/pull/539)).
* Fix issue with oembed fields not working correctly on options pages. ([#542](https://github.com/CMB2/CMB2/pull/542)).
* Fix issue with repeatable field <button> elements stealing focus from "submit" button.
## 2.1.2 - 2015-10-01
### Bug Fixes
* Fixes back-compatibility issue when adding fields array to the metabox registration. ([#472](https://github.com/CMB2/CMB2/pull/472))
## 2.1.1 - 2015-09-30
### Enhancements
* Make all CMB2::save_fields arguments optional to fall-back to `$_POST` data. Props [JPry](https://github.com/JPry).
* New filter, `cmb2_non_repeatable_fields` for adding additional fields to the blacklist of repeatable field-types. Props [JPry](https://github.com/JPry) ([#430](https://github.com/CMB2/CMB2/pull/430)).
* New recommended hook for adding metaboxes, `cmb2_admin_init`. Most metabox registration only needs to happen if in wp-admin, so there is no reason to register them when loading the front-end (and increase the memory usage). `cmb2_init` still exists to register metaboxes that will be used on the front-end or used on both the front and back-end. Instances of `cmb2_init` in example-functions.php have been switched to `cmb2_admin_init`.
* Add `'render_row_cb'` field parameter for overriding the field render method.
* Add `'label_cb'` field parameter for overriding the field label render method.
* Allow `CMB2_Types::checkbox()` method to be more flexible for extending by taking an args array and an `$is_checked` second argument.
* More thorough unit tests. Props [pglewis](https://github.com/pglewis), ([#447](https://github.com/CMB2/CMB2/pull/447),[#448](https://github.com/CMB2/CMB2/pull/448)).
* Update `CMB2_Utils::image_id_from_url` to be more reliable. Props [wpscholar](https://github.com/wpscholar), ([#453](https://github.com/CMB2/CMB2/pull/453)).
* `cmb2_get_option` now takes a default fallback value as a third parameter.
### Bug Fixes
* Address issue where `'file'` and `'file_list'` field results were getting mixed. Props [augustuswm](https://github.com/augustuswm) ([#382](https://github.com/CMB2/CMB2/pull/382), [#250](https://github.com/CMB2/CMB2/pull/250), [#296](https://github.com/CMB2/CMB2/pull/296)).
* Fix long-standing issues with radio and multicheck fields in repeatable groups losing their values when new rows are added. ([#341](https://github.com/CMB2/CMB2/pull/341), [#304](https://github.com/CMB2/CMB2/pull/304), [#263](https://github.com/CMB2/CMB2/pull/263), [#246](https://github.com/CMB2/CMB2/pull/246), [#150](https://github.com/CMB2/CMB2/pull/150))
* Fixes issue where currently logged-in user's profile data would display in the "Add New User" screen fields. ([#427](https://github.com/CMB2/CMB2/pull/427))
* Fixes issue where radio values/selections would not always properly transfer when shifting rows (up/down). Props [jamiechong](https://github.com/jamiechong) ([#429](https://github.com/CMB2/CMB2/pull/429), [#152](https://github.com/CMB2/CMB2/pull/152)).
* Fixes issue where repeatable groups display "Array" as the field values if group is left completely empty. ([#332](https://github.com/CMB2/CMB2/pull/332),[#390](https://github.com/CMB2/CMB2/pull/390)).
* Fixes issue with `'file_list'` fields not saving properly when in repeatable groups display. Props [jamiechong](https://github.com/jamiechong) ([#433](https://github.com/CMB2/CMB2/pull/433),[#187](https://github.com/CMB2/CMB2/pull/187)).
* Update `'taxonomy_radio_inline'` and `'taxonomy_multicheck_inline'` fields sanitization method to use the same method as the non-inline versions. Props [superfreund](https://github.com/superfreund) ([#454](https://github.com/CMB2/CMB2/pull/454)).
## 2.1.0 - 2015-08-05
### Bug Fixes
* Fix user fields not saving. Props [achavez](https://github.com/achavez), ([#417](https://github.com/CMB2/CMB2/pull/417)).
## 2.0.9 - 2015-07-28
### Enhancements
* Updated/Added many translations. Props [fxbenard](https://github.com/fxbenard), ([#203](https://github.com/CMB2/CMB2/pull/344)) and [Mte90](https://github.com/Mte90) for the Italian translation.
* Updated `'file_list'` field type to have a more intuitive selection in the media library, and updated the 'Use file' text in the button. Props [SteveHoneyNZ](https://github.com/SteveHoneyNZ) ([#357](https://github.com/CMB2/CMB2/pull/357), [#358](https://github.com/CMB2/CMB2/pull/358)).
* `'closed'` group field option parameter introduced in order to set the groups as collapsed by default. Requested in [#391](https://github.com/CMB2/CMB2/issues/391).
* Added `"cmb2_{$object_type}_process_fields_{$cmb_id}"` hook for hooking in and modifying the metabox or fields before the fields are processed/sanitized for saving.
* Added Comment Metabox support. Props [GregLancaster71](https://github.com/GregLancaster71) ([#238](https://github.com/CMB2/CMB2/pull/238), [#244](https://github.com/CMB2/CMB2/pull/244)).
* New `"cmb2_{$field_id}_is_valid_img_ext"`` filter for determining if a field value has a valid image file-type extension.
### Bug Fixes
* `'multicheck_inline'`, `'taxonomy_radio_inline'`, and `'taxonomy_multicheck_inline'` field types were not outputting anything since it's value was not being returned. Props [ediamin](https://github.com/ediamin), ([#367](https://github.com/CMB2/CMB2/pull/367), ([#405](https://github.com/CMB2/CMB2/pull/405)).
* `'hidden'` type fields were not honoring the `'show_on_cb'` callback. Props [JPry](https://github.com/JPry), ([commits](https://github.com/CMB2/CMB2/compare/5a4146eec546089fbe1a1c859d680dfda3a86ee2...1ef5ef1e3b2260ab381090c4abe9dc7234cfa0a6)).
* Fixed: There was no minified cmb2-front.min.css file.
* Fallback for fatal error with invalid timezone. Props [ryanduff](https://github.com/ryanduff) ([#385](https://github.com/CMB2/CMB2/pull/385)).
* Fix issues with deleting a row from repeatable group. Props [yuks](https://github.com/yuks) ([#387](https://github.com/CMB2/CMB2/pull/387)).
* Ensure value passed to `strtotime` in `make_valid_time_stamp` is cast to a string. Props [vajrasar](https://github.com/vajrasar) ([#389](https://github.com/CMB2/CMB2/pull/389)).
* Fixed issue with Windows IIS and bundling CMB2 in the theme. Props [DevinWalker](https://github.com/DevinWalker), ([#400](https://github.com/CMB2/CMB2/pull/400), [#401](https://github.com/CMB2/CMB2/pull/401))
## 2.0.8 - 2015-06-01
### Bug Fixes
* Fix color-picker field not enqueueing the colorpicker script. ([#333](https://github.com/CMB2/CMB2/issues/333))
## 2.0.7 - 2015-05-28
### Enhancements
* Ability to use non-repeatable group fields by setting the `'repeatable'` field param to `false` when registering a group field type. Props [marcusbattle](https://github.com/marcusbattle), ([#159](https://github.com/CMB2/CMB2/pull/159)).
* Add and enqeueue a front-end specific CSS file which adds additional styles which are typically covered by wp-admin css. ([#311](https://github.com/CMB2/CMB2/issues/311))
* Better handling of the CMB2 javascript (and CSS) required dependencies array. Dependencies are now only added conditionally based on the field types that are actually visible. ([#136](https://github.com/CMB2/CMB2/issues/136))
* **THIS IS A BREAKING CHANGE:** The `group` field type's `'show_on_cb'` parameter now receives the `CMB2_Field` object instance as an argument instead of the `CMB2` instance. If you're using the `'show_on_cb'` parameter for a `group` field, please adjust accordingly. _note: you can still retrieve the `CMB2` instance via the `cmb2_get_metabox` helper function._
* New dynamic hook, `"cmb2_save_{$object_type}_fields_{$this->cmb_id}"`, to complement the existing `"cmb2_save_{$object_type}_fields"` hook.
* New CMB2 parameter, `enqueue_js`, to disable the enqueueing of the CMB2 Javascript.
* German translation provided by Friedhelm Jost.
### Bug Fixes
* Fix incorrect repeatable group title number. ([#310](https://github.com/CMB2/CMB2/pull/310))
* Fix obscure bug which prevented group field arguments from being passed to the sub-fields (like `show_names` and `context`).
* Fixed occasional issue when adding a group row, the previous row's content would be cloned. ([#257](https://github.com/CMB2/CMB2/pull/257))
## 2.0.6 - 2015-04-30
### Enhancements
* New metabox/form parameter, `show_on_cb`, allows you to conditionally display a cmb metabox/form via a callback. The `$cmb` object gets passed as a parameter to the callback. This complements the `'show_on_cb'` parameter that already exists for individual fields. Using this callback is similar to using the `'cmb2_show_on'` filter, but only applies to that specific metabox and it is recommended to use this callback instead as it minimizes th risk that your filter will affect other metaboxes.
* Taxonomy types no longer save a value. The value getting saved was causing confusion and is not meant to be used. To use the saved taxonomy data, you need to use the WordPress term api, `get_the_terms `, `get_the_term_list`, etc.
* Add `'multiple'` field parameter to store values in individual rows instead of serialized array. Will only work if field is not repeatable or a repeatable group. Props [JohnyGoerend](https://github.com/JohnyGoerend). ([#262](https://github.com/CMB2/CMB2/pull/262), [#206](https://github.com/CMB2/CMB2/issues/206), [#45](https://github.com/CMB2/CMB2/issues/45)).
* Portuguese (Brazil) translation provided by [@lucascdsilva](https://github.com/lucascdsilva) - [#293](https://github.com/CMB2/CMB2/pull/293).
* Spanish (Spain) translation updated by [@yivi](https://github.com/yivi) - [#272](https://github.com/CMB2/CMB2/pull/272).
* Added group field callback parameters, `'before_group'`, `'before_group_row'`, `'after_group_row'`, `'after_group'` to complement the `'before_row'`, `'before'`, `'after'`, `'after_row'` field parameters.
* Better styling for `title` fields and `title` descriptions on options pages.
* Add a `sanitization_cb` field parameter check for the `group` field type.
* Better function/file doc-blocks to provide better documentation for automated documentation tools. See: [cmb2.io/api](http://cmb2.io/api/).
* `cmb2_print_metabox_form`, `cmb2_metabox_form`, and `cmb2_get_metabox_form` helper functions now accept two new parameters:
* an `'object_type'` parameter to explictly set that in the `$cmb` object.
* an `'enqueue_js'` parameter to explicitly disable the CMB JS enqueue. This is handy if you're not planning on using any of the fields which require JS (like color/date pickers, wysiwyg, file, etc).
### Bug Fixes
* Fix issue with oembed fields in repeatable groups where changing video changed it for all fields in a group.
* Fix empty arrays (like in the group field) saving as a value.
* Move `'cmb2_override_meta_value'` and `"cmb2_override_{$field_id}_meta_value"` filters to the `CMB2_Field::get_data()` method so that the filters are applied every time the data is requested. **THIS IS A BREAKING CHANGE:** The parameters for those filters have changed a bit. Previously, the filters accepted 5 arguments, `$value`, `$object_id`, `$field_args`, `$object_type`, `$field`. They have changed to accept 4 arguments instead, `$value`, `$object_id`, `$args`, `$field`, where `$args` is an array that contains the following:
* @type string $type The current object type
* @type int $id The current object ID
* @type string $field_id The ID of the field being requested
* @type bool $repeat Whether current field is repeatable
* @type bool $single Whether current field is a single database row
## 2.0.5 - 2015-03-17
### Bug Fixes
* Fix grouped fields display (first field was being repeated), broken in 2.0.3.
## 2.0.4 - 2015-03-16
### Enhancements
* `select`, `radio`, `radio_inline` field types now all accept the `'show_option_none'` field parameter. This parameter allows you to set the text to display for showing a 'no selection' option. Default will be `false`, which means a 'none' option will not be added. Set to `true` to use the default text, 'None', or specify another value, i.e. 'No selection'.
### Bug Fixes
* Fix back-compatibility when adding group field sub-fields via old array method (vs using the `CMB2:add_group_field()` method). Thanks to [norcross](https://github.com/norcross) for reporting.
* Fix occasional jQuery issues with group-field indexes.
## 2.0.3 - 2015-03-15
### Enhancements
* New constant, `CMB2_DIR`, which stores the file-path to the CMB2 directory.
* `text_date`, `text_time`, `text_date_timestamp`, `text_datetime_timestamp`, and ` text_datetime_timestamp_timezone` field types now take an arguments array so they can be extended by custom field types.
* Removed auto-scroll when adding groups. To re-add the feature, use the [snippet/plugin here](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/javascript/cmb2-auto-scroll-to-new-group.php). ([#205](https://github.com/CMB2/CMB2/issues/205))
* Updated Timepicker utilizing the [@trentrichardson](https://github.com/trentrichardson) jQuery Timepicker add-on (https://github.com/trentrichardson/jQuery-Timepicker-Addon), and updated Datepicker styles. Props [JonMasterson](https://github.com/JonMasterson). ([#204](https://github.com/CMB2/CMB2/issues/204), [#206](https://github.com/CMB2/CMB2/issues/206), [#45](https://github.com/CMB2/CMB2/issues/45)).
* Added a callback option for the field default value. The callback gets passed an array of all the field parameters as the first argument, and the field object as the second argument. (which means you can get the post id using `$field->object_id`). ([#233](https://github.com/CMB2/CMB2/issues/233)).
* New `CMB2::get_field()` method and `cmb2_get_field` helper function for retrieving a `CMB2_Field` object from the array of registered fields for a metabox.
* New `CMB2::get_sanitized_values()` method and `cmb2_get_metabox_sanitized_values` helper function for retrieving sanitized values from an array of values (usually `$_POST` data).
* New `'save_fields'` metabox parameter that can be used to disable (by setting `'save_fields' => false`) the automatic saving of the fields when the form is submitted. These can be useful when you want to handle the saving of the fields yourself, or want to use submitted data for other purposes like generating new posts, or sending emails, etc.
### Bug Fixes
* Fix commented out text_datetime_timestamp_timezone field registration example in `example-functions.php`. Props [cliffordp](https://github.com/cliffordp), ([#203](https://github.com/CMB2/CMB2/pull/203)).
* Fix sidebar styling for money fields and fields with textareas. ([#234](https://github.com/CMB2/CMB2/issues/234))
* Fix `CMB2_Sanitize` class to properly use the stripslashed value (which was added in [#162](https://github.com/CMB2/CMB2/pull/162) but never used). Props [dustyf](https://github.com/dustyf), ([#241](https://github.com/CMB2/CMB2/pull/241)).
## 2.0.2 - 2015-02-15
### Enhancements
* Use the more appropriate `add_meta_boxes` hook for hooking in metaboxes to post-edit screen. Thanks [@inspiraaz](https://github.com/inspiraaz) for reporting. ([#161](https://github.com/CMB2/CMB2/issues/161))
* Add a `row_classes` field param which allows you to add additional classes to the cmb-row wrap. This parameter can take a string, or array, or can take a callback that returns a string or array. The callback will receive `$field_args` as the first argument, and the CMB2_Field `$field` object as the second argument. Reported/requested in [#68](https://github.com/CMB2/CMB2/issues/68).
* New constant, `CMB2_LOADED`, which you can use to check if CMB2 is loaded for your plugins/themes with CMB2 dependency.
* New hooks, [`cmb2_init_before_hookup` and `cmb2_after_init`](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/filters-and-actions).
* New API for adding metaboxes and fields, demonstrated in [`example-functions.php`](https://github.com/CMB2/CMB2/blob/master/example-functions.php). In keeping with backwards-compatibility, the `cmb2_meta_boxes` filter method will still work, but is not recommended. New API includes `new_cmb2_box` helper function to generate a new metabox, and returns a `$cmb` object to add new fields (via the `CMB2::add_field()` and `CMB2::add_group_field()` methods).
* New CMB2 method, [`CMB2::remove_field()`](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/filters-and-actions/cmb2_init_%24cmb_id-remove-field.php).
* New CMB2_Boxes method, [`CMB2_Boxes::remove()`](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/filters-and-actions/cmb2_init_before_hookup-remove-cmb2-metabox.php).
* When clicking on a file/image in the `file`, or `file_list` type, the media modal will open with that image selected. Props [johnsonpaul1014](https://github.com/johnsonpaul1014), ([#120](https://github.com/CMB2/CMB2/pull/120)).
## 2.0.1 - 2015-02-02
2.0.1 is the official version after beta, and includes all the changes from 2.0.0 (beta).
## 2.0.0(beta) - 2014-08-16
2.0.0 is the official version number for the transition to CMB2, and 2.0.1 is the official version after beta. It is a complete rewrite. Improvements and fixes are listed below. __Note: This release requires WordPress 3.8+__
### Enhancements
* Converted `<table>` markup to more generic `<div>` markup to be more extensible and allow easier styling.
* Much better handling and display of repeatable groups.
* Entirely translation-ready [with full translations](http://wp-translations.org/project/cmb2/) in Spanish, French (Props [@fredserva](https://github.com/fredserva) - [#127](https://github.com/CMB2/CMB2/pull/127)), Finnish (Props [@onnimonni](https://github.com/onnimonni) - [#108](https://github.com/CMB2/CMB2/pull/108)), Swedish (Props [@EyesX](https://github.com/EyesX) - [#141](https://github.com/CMB2/CMB2/pull/141)), and English.
* Add cmb fields to new user page. Props [GioSensation](https://github.com/GioSensation), ([#645](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/645)).
* Improved and additional [helper-functions](https://github.com/CMB2/CMB2/blob/master/includes/helper-functions.php).
* Added new features and translation for datepicker. Props [kalicki](https://github.com/kalicki), ([#657](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/657)).
* General code standards cleanup. Props [gregrickaby](https://github.com/gregrickaby), ([#17](https://github.com/CMB2/CMB2/pull/17) & others).
* Use SASS for development. Props [gregrickaby](https://github.com/gregrickaby), ([#18](https://github.com/CMB2/CMB2/pull/18)).
* New `hidden` field type.
* [Ability to override text strings in fields via field options parameter](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#override-text-strings-in-field).
* Added composer.json. Props [nlemoine](https://github.com/nlemoine), ([#19](https://github.com/CMB2/CMB2/pull/19)).
* New field 'hooks' can take [static text/html](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#inject-static-content-in-a-field) or a [callback](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#inject-dynamic-content-in-a-field-via-a-callback).
* New `preview_size` parameter for `file` field type. Takes an array or named image size.
* Empty index.php file to all folders (for more security). Props [brunoramalho](https://github.com/brunoramalho), ([#41](https://github.com/CMB2/CMB2/pull/41)).
* Clean up styling. Props [brunoramalho](https://github.com/brunoramalho), ([#43](https://github.com/CMB2/CMB2/pull/43)) and [senicar](https://github.com/senicar).
* Collapsible field groups. Props [cluke009](https://github.com/cluke009), ([#59](https://github.com/CMB2/CMB2/pull/59)).
* Allow for override of update/remove for CMB2_Field. Props [sc0ttkclark](https://github.com/sc0ttkclark), ([#65](https://github.com/CMB2/CMB2/pull/65)).
* Use class button-disabled instead of disabled="disabled" for <a> buttons. Props [sc0ttkclark](https://github.com/sc0ttkclark), ([#66](https://github.com/CMB2/CMB2/pull/66)).
* [New before/after dynamic form hooks](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#using-the-dynamic-beforeafter-form-hooks).
* Larger unit test coverage. Props to [@pmgarman](https://github.com/pmgarman) for assistance. ([#90](https://github.com/CMB2/CMB2/pull/90) and [#91](https://github.com/CMB2/CMB2/pull/91))
* Added helper function to update an option. Props [mAAdhaTTah](https://github.com/mAAdhaTTah), ([#110](https://github.com/CMB2/CMB2/pull/110)).
* More JS hooks during repeat group shifting. Props [AlchemyUnited](https://github.com/AlchemyUnited), ([#125](https://github.com/CMB2/CMB2/pull/125)).
* [New metabox config option for defaulting to closed](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#setting-a-metabox-to-closed-by-default).
* New hooks, [`cmb2_init`](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#using-cmb2-helper-functions-and-cmb2_init) and `cmb2_init_{$cmb_id}`.
### Bug Fixes
* New mechanism to ensure CMB2 only loads the most recent version of CMB2 in your system. This fixes the issue where another bundled version could conflict or take precendent over your up-to-date version.
* Fix issue with field labels being hidden. Props [mustardBees](https://github.com/mustardBees), ([#48](https://github.com/CMB2/CMB2/pull/48)).
* Address issues with autoloading before autoloader is setup. Props [JPry](https://github.com/JPry), ([#56](https://github.com/CMB2/CMB2/pull/56)).
* Fixed 'show_on_cb' for field groups. Props [marcusbattle](https://github.com/marcusbattle), ([#98](https://github.com/CMB2/CMB2/pull/98)).
* Make get_object_terms work with and without object caching. Props [joshlevinson](https://github.com/joshlevinson), ([#105](https://github.com/CMB2/CMB2/pull/105)).
* Don't use `__DIR__` in example-functions.php to ensure PHP 5.2 compatibility. Props [bryceadams](https://github.com/bryceadams), ([#129](https://github.com/CMB2/CMB2/pull/129)).
* Added support for radio input swapping in repeatable fields. Props [DevinWalker](https://github.com/DevinWalker), ([#138](https://github.com/CMB2/CMB2/pull/138), [#149](https://github.com/CMB2/CMB2/pull/149)).
* Fix metabox form not being returned to caller. Props [akshayagarwal](https://github.com/akshayagarwal), ([#145](https://github.com/CMB2/CMB2/pull/145)).
* Run stripslashes before saving data, since WordPress forces magic quotes. Props [clifgriffin](https://github.com/clifgriffin), ([#162](https://github.com/CMB2/CMB2/pull/162)).
## 1.3.0 - (never released, merged into CMB2)
### Enhancements
* Localize Date, Time, and Color picker defaults so that they can be overridden via the `cmb_localized_data` filter. ([#528](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/528))
* Change third parameter for 'cmb_metabox_form' to be an args array. Optional arguments include `echo`, `form_format`, and `save_button`.
* Add support for `show_option_none` argument for `taxonomy_select` and `taxonomy_radio` field types. Also adds the following filters: `cmb_all_or_nothing_types`, `cmb_taxonomy_select_default_value`, `cmb_taxonomy_select_{$this->_id()}_default_value`, `cmb_taxonomy_radio_{$this->_id()}_default_value`, `cmb_taxonomy_radio_default_value`. Props [@pmgarman](https://github.com/pmgarman), ([#569](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/569)).
* Make the list items in the `file_list` field type drag & drop sortable. Props [twoelevenjay](https://github.com/twoelevenjay), ([#603](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/603)).
### Bug Fixes
* Fixed typo in closing `</th>` tag. Props [@CivicImages](https://github.com/CivicImages). ([#616](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/616))
## 1.2.0 - 2014-05-03
### Enhancements
* Add support for custom date/time formats. Props [@Scrent](https://github.com/Scrent). ([#506](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/506))
* Simplify `wysiwyg` escaping and allow it to be overridden via the `escape_cb` parameter. ([#491](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/491))
* Add a 'Select/Deselect all' button for the `multicheck` field type.
* Add title option for [repeatable groups](https://github.com/CMB2/CMB2/wiki/Field-Types#group). Title field takes an optional replacement hash, "{#}" that will be replaced by the row number.
* New field parameter, `show_on_cb`, allows you to conditionally display a field via a callback. ([#47](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/47))
* Unit testing (the beginning). Props [@brichards](https://github.com/brichards) and [@camdensegal](https://github.com/camdensegal).
### Bug Fixes
* Fixed issue where remove file button wouldn't clear the url field. ([#514](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/514))
* `wysiwyg` fields now allow underscores. Fixes some wysiwyg display issues in WordPress 3.8. Props [@lswilson](https://github.com/lswilson). ([#491](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/491))
* Nonce field should only be added once per page. ([#521](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/521))
* Fix `in_array` issue when a post does not have any saved terms for a taxonomy multicheck. ([#527](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/527))
* Fixed error: 'Uninitialized string offset: 0 in cmb_Meta_Box_field.php...`. Props [@DevinWalker](https://github.com/DevinWalker). ([#539](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/539), [#549](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/549)))
* Fix missing `file` field description. ([#543](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/543), [#547](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/547))
## 1.1.3 - 2014-04-07
### Bug Fixes
* Update `cmb_get_field_value` function as it was passing the parameters to `cmb_get_field` in the wrong order.
* Fix repeating fields not working correctly if meta key or prefix contained an integer. ([#503](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/503))
## 1.1.2 - 2014-04-05
### Bug Fixes
* Fix issue with `cmb_Meta_Box_types.php` calling a missing method, `image_id_from_url`. ([#502](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/502))
## 1.1.1 - 2014-04-03
### Bug Fixes
* Radio button values were not showing saved value. ([#500](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/500))
## 1.1.0 - 2014-04-02
### Enhancements
* [Repeatable groups](https://github.com/CMB2/CMB2/wiki/Field-Types#group)
* Support for more fields to be repeatable, including oEmbed field, and date, time, and color picker fields, etc.
* Codebase has been revamped to be more modular and object-oriented.
* New filter, `"cmb_{$element}_attributes" ` for modifying an element's attributes.
* Every field now supports an `attributes` parameter that takes an array of attributes. [Read more](https://github.com/CMB2/CMB2/wiki/Field-Types#attributes).
* Removed `cmb_std_filter` in favor of `cmb_default_filter`. **THIS IS A BREAKING CHANGE**
* Better handling of labels in sidebar. They are now placed on top of the input rather than adjacent.
* Added i18n compatibility to text_money. props [@ArchCarrier](https://github.com/ArchCarrier), ([#485](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/485))
* New helper functions: `cmb_get_field` and `cmb_get_field_value` for getting access to CMB's field object and/or value.
* New JavaScript events, `cmb_add_row` and `cmb_remove_row` for hooking in and manipulating the new row's data.
* New filter, `cmb_localized_data`, for modifiying localized data passed to the CMB JS.
### Bug Fixes
* Resolved occasional issue where only the first character of the label/value was diplayed. props [@mustardBees](https://github.com/mustardBees), ([#486](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/486))
## 1.0.2 - 2014-03-03
### Enhancements
* Change the way the `'cmb_validate_{$field['type']}'` filter works.
It is now passed a null value vs saved value. If null is returned, default sanitization will follow. **THIS IS A BREAKING CHANGE**. If you're already using this filter, take note.
* All field types that take an option array have been simplified to take `key => value` pairs (vs `array( 'name' => 'value', 'value' => 'key', )`). This effects the 'select', 'radio', 'radio_inline' field types. The 'multicheck' field type was already using the `key => value` format. Backwards compatibility has been maintained for those using the older style.
* Added default value option for `taxonomy_select` field type. props [@darlantc](https://github.com/darlantc), ([#473](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/473))
* Added `preview_size` parameter for `file_list` field type. props [@IgorCode](https://github.com/IgorCode), ([#471](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/471))
* Updated `file_list` images to be displayed horizontally instead of vertically. props [@IgorCode](https://github.com/IgorCode), ([#467](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/467))
* Use `get_the_terms` where possible since the data is cached.
### Bug Fixes
* Fixed wysiwyg escaping slashes. props [@gregrickaby](https://github.com/gregrickaby), ([#465](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/465))
* Replaced `__DIR__`, as `dirname( __FILE__ )` is easier to maintain back-compatibility.
* Fixed missing table styling on new posts. props [@mustardBees](https://github.com/mustardBees), ([#438](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/438))
* Fix undeclared JS variable. [@veelen](https://github.com/veelen), ([#451](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/451))
* Fix `file_list` errors when removing all files and saving.
* Set correct `object_id` to be used later in `cmb_show_on` filter. [@lauravaq](https://github.com/lauravaq), ([#445](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/445))
* Fix sanitization recursion memeory issues.
## 1.0.1 - 2014-01-24
### Enhancements
* Now works with option pages and site settings. ([view example in wiki](https://github.com/CMB2/CMB2/wiki/Using-CMB-to-create-an-Admin-Theme-Options-Page))
* two filters to override the setting and getting of options, `cmb_override_option_get_$option_key` and `cmb_override_option_save_$option_key` respectively. Handy for using plugins like [WP Large Options](https://github.com/voceconnect/wp-large-options/) ([also here](http://vip.wordpress.com/plugins/wp-large-options/)).
* Improved styling on taxonomy (\*tease\*) and options pages and for new 3.8 admin UI.
* New sanitization class to sanitize data when saved.
* New callback field parameter, `sanitization_cb`, for performing your own sanitization.
* new `cmb_Meta_Box_types::esc()` method that handles escaping data for display.
* New callback field parameter, `escape_cb`, for performing your own data escaping, as well as a new filter, `'cmb_types_esc_'. $field['type']`.
### Bug Fixes
* Fixed wysiwyg editor button padding. props [@corvannoorloos](https://github.com/corvannoorloos), ([#391](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/391))
* A few php < 5.3 errors were addressed.
* Fields with quotation marks no longer break the input/textarea fields.
* metaboxes for Attachment pages now save correctly. Thanks [@nciske](https://github.com/nciske) for reporting. ([#412](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/412))
* Occasionally fields wouldn't save because of the admin show_on filter.
* Smaller images loaded to the file field type will no longer be blown up larger than their dimensions.
## 1.0.0 - 2013-11-30
* Added `text_datetime_timestamp_timezone` type, a datetime combo field with an additional timezone drop down, props [@dessibelle](https://github.com/dessibelle)
* Added `select_timezone` type, a standalone time zone select dropdown. The time zone select can be used with standalone `text_datetime_timestamp` if desired. Props [@dessibelle](https://github.com/dessibelle)
* Added `text_url` type, a basic url field. Props [@dessibelle](https://github.com/dessibelle)
* Added `text_email` type, a basic email field. Props [@dessibelle](https://github.com/dessibelle)
* Added ability to display metabox fields in frontend. Default is true, but can be overriden using the `cmb_allow_frontend filter`. If set to true, an entire metabox form can be output with the `cmb_metabox_form( $meta_box, $object_id, $echo )` function. Props [@dessibelle](https://github.com/dessibelle), [@messenlehner](https://github.com/messenlehner) & [@jtsternberg](https://github.com/jtsternberg).
* Added hook `cmb_after_table` after all metabox output. Props [@wpsmith](https://github.com/wpsmith)
* `file_list` now works like a repeatable field. Add as many files as you want. Props [@coreymcollins](https://github.com/coreymcollins)
* `text`, `text_small`, `text_medium`, `text_url`, `text_email`, & `text_money` fields now all have the option to be repeatable. Props [@jtsternberg](https://github.com/jtsternberg)
* Custom metaboxes can now be added for user meta. Add them on the user add/edit screen, or in a custom user profile edit page on the front-end. Props [@tw2113](https://github.com/tw2113), [@jtsternberg](https://github.com/jtsternberg)
## 0.9.4
* Added field "before" and "after" options for each field. Solves issue with '$' not being the desired text_money monetary symbol, props [@GaryJones](https://github.com/GaryJones)
* Added filter for 'std' default fallback value, props [@messenlehner](https://github.com/messenlehner)
* Ensure oEmbed videos fit in their respective metaboxes, props [@jtsternberg](https://github.com/jtsternberg)
* Fixed issue where an upload field with 'show_names' disabled wouldn't have the correct button label, props [@jtsternberg](https://github.com/jtsternberg)
* Better file-extension check for images, props [@GhostToast](https://github.com/GhostToast)
* New filter, `cmb_valid_img_types`, for whitelisted image file-extensions, props [@jtsternberg](https://github.com/jtsternberg)
## 0.9.3
* Added field type and field id classes to each cmb table row, props [@jtsternberg](https://github.com/jtsternberg)
## 0.9.2
* Added post type comparison to prevent storing null values for taxonomy selectors, props [@norcross](https://github.com/norcross)
## 0.9.1
* Added `oEmbed` field type with ajax display, props [@jtsternberg](https://github.com/jtsternberg)
## 0.9
* __Note: This release requires WordPress 3.3+__
* Cleaned up scripts being queued, props [@jaredatch](https://github.com/jaredatch)
* Cleaned up and reorganized jQuery, props [@GaryJones](https://github.com/GaryJones)
* Use $pagenow instead of custom $current_page, props [@jaredatch](https://github.com/jaredatch)
* Fixed CSS, removed inline styles, now all in style.css, props [@jaredatch](https://github.com/jaredatch)
* Fixed multicheck issues (issue #48), props [@jaredatch](https://github.com/jaredatch)
* Fixed jQuery UI datepicker CSS conflicting with WordPress UI elements, props [@jaredatch](https://github.com/jaredatch)
* Fixed zeros not saving in fields, props [@GaryJones](https://github.com/GaryJones)
* Fixed improper labels on radio and multicheck fields, props [@jaredatch](https://github.com/jaredatch)
* Fixed fields not rendering properly when in sidebar, props [@jaredatch](https://github.com/jaredatch)
* Fixed bug where datepicker triggers extra space after footer in Firefox (issue #14), props [@jaredatch](https://github.com/jaredatch)
* Added jQuery UI datepicker packaged with 3.3 core, props [@jaredatch](https://github.com/jaredatch)
* Added date time combo picker, props [@jaredatch](https://github.com/jaredatch)
* Added color picker, props [@jaredatch](https://github.com/jaredatch)
* Added readme.md markdown file, props [@jaredatch](https://github.com/jaredatch)
## 0.8 - 2012-01-19
* Added jQuery timepicker, props [@norcross](https://github.com/norcross)
* Added 'raw' textarea to convert special HTML entities back to characters, props [@norcross](https://github.com/norcross)
* Added missing examples on example-functions.php, props [@norcross](https://github.com/norcross)
## 0.7
* Added the new wp_editor() function for the WYSIWYG dialog box, props [@jcpry](https://github.com/jcpry)
* Created 'cmb_show_on' filter to define your own Show On Filters, props [@billerickson](https://github.com/billerickson)
* Added page template show_on filter, props [@billerickson](https://github.com/billerickson)
* Improvements to the 'file' field type, props [@randyhoyt](https://github.com/randyhoyt)
* Allow for default values on 'radio' and 'radio_inline' field types, props [@billerickson](https://github.com/billerickson)
## 0.6.1
* Enabled the ability to define your own custom field types (issue #28). props [@randyhoyt](https://github.com/randyhoyt)
## 0.6
* Added the ability to limit metaboxes to certain posts by id. props [@billerickson](https://github.com/billerickson)
## 0.5
* Fixed define to prevent notices. props [@destos](https://github.com/destos)
* Added text_date_timestap option. props [@andrewyno](https://github.com/andrewyno)
* Fixed WYSIWYG paragraph breaking/spacing bug. props [@wpsmith](https://github.com/wpsmith)
* Added taxonomy_radio and taxonomies_select options. props [@c3mdigital](https://github.com/c3mdigital)
* Fixed script causing the dashboard widgets to not be collapsible.
* Fixed various spacing and whitespace inconsistencies
## 0.4
* Think we have a release that is mostly working. We'll say the initial release :)

View File

@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at hello@cmb2.io. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -0,0 +1,84 @@
<?php
/**
* Bootstraps the CMB2 process
*
* @category WordPress_Plugin
* @package CMB2
* @author CMB2
* @license GPL-2.0+
* @link https://cmb2.io
*/
/**
* Function to encapsulate the CMB2 bootstrap process.
*
* @since 2.2.0
* @return void
*/
function cmb2_bootstrap() {
if ( is_admin() ) {
/**
* Fires on the admin side when CMB2 is included/loaded.
*
* In most cases, this should be used to add metaboxes. See example-functions.php
*/
do_action( 'cmb2_admin_init' );
}
/**
* Fires when CMB2 is included/loaded
*
* Can be used to add metaboxes if needed on the front-end or WP-API (or the front and backend).
*/
do_action( 'cmb2_init' );
/**
* For back-compat. Does the dirty-work of instantiating all the
* CMB2 instances for the cmb2_meta_boxes filter
*
* @since 2.0.2
*/
$cmb_config_arrays = apply_filters( 'cmb2_meta_boxes', array() );
foreach ( (array) $cmb_config_arrays as $cmb_config ) {
new CMB2( $cmb_config );
}
/**
* Fires after all CMB2 instances are created
*/
do_action( 'cmb2_init_before_hookup' );
/**
* Get all created metaboxes, and instantiate CMB2_Hookup
* on metaboxes which require it.
*
* @since 2.0.2
*/
foreach ( CMB2_Boxes::get_all() as $cmb ) {
/**
* Initiates the box "hookup" into WordPress.
*
* Unless the 'hookup' box property is `false`, the box will be hooked in as
* a post/user/comment/option/term box.
*
* And if the 'show_in_rest' box property is set, the box will be hooked
* into the CMB2 REST API.
*
* The dynamic portion of the hook name, $cmb->cmb_id, is the box id.
*
* @since 2.2.6
*
* @param array $cmb The CMB2 object to hookup.
*/
do_action( "cmb2_init_hookup_{$cmb->cmb_id}", $cmb );
}
/**
* Fires after CMB2 initiation process has been completed
*/
do_action( 'cmb2_after_init' );
}
/* End. That's it, folks! */

View File

@@ -0,0 +1,45 @@
/*!
* CMB2 - v2.11.0 - 2024-04-02
* https://cmb2.io
* Copyright (c) 2024
* Licensed GPLv2+
*/
/*--------------------------------------------------------------
* CMB2 Display Styling
--------------------------------------------------------------*/
/* line 6, sass/partials/_display.scss */
.cmb2-colorpicker-swatch span {
display: inline-block;
width: 1em;
height: 1em;
border-radius: 1em;
float: right;
margin-top: 3px;
margin-left: 2px;
}
/* line 17, sass/partials/_display.scss */
.cmb2-code {
overflow: scroll;
}
/* line 21, sass/partials/_display.scss */
.cmb-image-display {
max-width: 100%;
height: auto;
}
/* line 26, sass/partials/_display.scss */
.cmb2-display-file-list li {
display: inline;
margin: 0 0 .5em .5em;
}
/* line 31, sass/partials/_display.scss */
.cmb2-oembed * {
max-width: 100%;
height: auto;
}
/*# sourceMappingURL=cmb2-display.css.map */

View File

@@ -0,0 +1 @@
.cmb2-colorpicker-swatch span{display:inline-block;width:1em;height:1em;border-radius:1em;float:right;margin-top:3px;margin-left:2px}.cmb2-code{overflow:scroll}.cmb-image-display{max-width:100%;height:auto}.cmb2-display-file-list li{display:inline;margin:0 0 .5em .5em}.cmb2-oembed *{max-width:100%;height:auto}

View File

@@ -0,0 +1,45 @@
/*!
* CMB2 - v2.11.0 - 2024-04-02
* https://cmb2.io
* Copyright (c) 2024
* Licensed GPLv2+
*/
/*--------------------------------------------------------------
* CMB2 Display Styling
--------------------------------------------------------------*/
/* line 6, sass/partials/_display.scss */
.cmb2-colorpicker-swatch span {
display: inline-block;
width: 1em;
height: 1em;
border-radius: 1em;
float: left;
margin-top: 3px;
margin-right: 2px;
}
/* line 17, sass/partials/_display.scss */
.cmb2-code {
overflow: scroll;
}
/* line 21, sass/partials/_display.scss */
.cmb-image-display {
max-width: 100%;
height: auto;
}
/* line 26, sass/partials/_display.scss */
.cmb2-display-file-list li {
display: inline;
margin: 0 .5em .5em 0;
}
/* line 31, sass/partials/_display.scss */
.cmb2-oembed * {
max-width: 100%;
height: auto;
}
/*# sourceMappingURL=cmb2-display.css.map */

View File

@@ -0,0 +1,7 @@
{
"version": 3,
"mappings": "AAAA;;gEAEgE;;AAG/D,6BAAK;EACJ,OAAO,EAAE,YAAY;EACrB,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,GAAG;EACX,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,GAAG;EACf,YAAY,EAAE,GAAG;;;;AAInB,UAAW;EACV,QAAQ,EAAE,MAAM;;;;AAGjB,kBAAmB;EAClB,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,IAAI;;;;AAGb,0BAA2B;EAC1B,OAAO,EAAE,MAAM;EACf,MAAM,EAAE,aAAa;;;;AAGtB,cAAe;EACd,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,IAAI",
"sources": ["sass/partials/_display.scss"],
"names": [],
"file": "cmb2-display.css"
}

View File

@@ -0,0 +1 @@
.cmb2-colorpicker-swatch span{display:inline-block;width:1em;height:1em;border-radius:1em;float:left;margin-top:3px;margin-right:2px}.cmb2-code{overflow:scroll}.cmb-image-display{max-width:100%;height:auto}.cmb2-display-file-list li{display:inline;margin:0 .5em .5em 0}.cmb2-oembed *{max-width:100%;height:auto}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden

View File

@@ -0,0 +1,31 @@
/*--------------------------------------------------------------
* CMB2 Display Styling
--------------------------------------------------------------*/
.cmb2-colorpicker-swatch span {
display: inline-block;
width: 1em;
height: 1em;
border-radius: 1em;
float: left;
margin-top: 3px;
margin-right: 2px;
}
.cmb2-code {
overflow: scroll;
}
.cmb-image-display {
max-width: 100%;
height: auto;
}
.cmb2-display-file-list li {
display: inline;
margin: 0 0.5em 0.5em 0;
}
.cmb2-oembed * {
max-width: 100%;
height: auto;
}/*# sourceMappingURL=cmb2-display.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["partials\\_display.scss","cmb2-display.css"],"names":[],"mappings":"AAAA;;+DAAA;AAKC;EACC,qBAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;ACDF;;ADKA;EACC,gBAAA;ACFD;;ADKA;EACC,eAAA;EACA,YAAA;ACFD;;ADKA;EACC,eAAA;EACA,uBAAA;ACFD;;ADKA;EACC,eAAA;EACA,YAAA;ACFD","file":"cmb2-display.css","sourcesContent":["/*--------------------------------------------------------------\n * CMB2 Display Styling\n--------------------------------------------------------------*/\n\n.cmb2-colorpicker-swatch {\n\tspan {\n\t\tdisplay: inline-block;\n\t\twidth: 1em;\n\t\theight: 1em;\n\t\tborder-radius: 1em;\n\t\tfloat: left;\n\t\tmargin-top: 3px;\n\t\tmargin-right: 2px;\n\t}\n}\n\n.cmb2-code {\n\toverflow: scroll;\n}\n\n.cmb-image-display {\n\tmax-width: 100%;\n\theight: auto;\n}\n\n.cmb2-display-file-list li {\n\tdisplay: inline;\n\tmargin: 0 .5em .5em 0;\n}\n\n.cmb2-oembed * {\n\tmax-width: 100%;\n\theight: auto;\n}\n","/*--------------------------------------------------------------\n * CMB2 Display Styling\n--------------------------------------------------------------*/\n.cmb2-colorpicker-swatch span {\n display: inline-block;\n width: 1em;\n height: 1em;\n border-radius: 1em;\n float: left;\n margin-top: 3px;\n margin-right: 2px;\n}\n\n.cmb2-code {\n overflow: scroll;\n}\n\n.cmb-image-display {\n max-width: 100%;\n height: auto;\n}\n\n.cmb2-display-file-list li {\n display: inline;\n margin: 0 0.5em 0.5em 0;\n}\n\n.cmb2-oembed * {\n max-width: 100%;\n height: auto;\n}"]}

View File

@@ -0,0 +1 @@
@import "partials/display";

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,15 @@
@import "partials/variables";
@import "partials/mixins";
@import "partials/main_wrap";
@import "partials/post_metaboxes";
@import "partials/context_metaboxes";
@import "partials/misc";
@import "partials/collapsible_ui";
@import "partials/jquery_ui";
@import "partials/char_counter";
/**
* CMB2 Frontend
*/
@import "partials/front";

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
@import "partials/variables";
@import "partials/mixins";
@import "partials/main_wrap";
@import "partials/post_metaboxes";
@import "partials/context_metaboxes";
@import "partials/options-page";
@import "partials/new_term";
@import "partials/misc";
@import "partials/sidebar_placements";
@import "partials/collapsible_ui";
@import "partials/jquery_ui";
@import "partials/char_counter";

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden

View File

@@ -0,0 +1,28 @@
/*--------------------------------------------------------------
* Character counter
--------------------------------------------------------------*/
.cmb2-char-counter-wrap {
margin: .5em 0 1em;
input[type="text"] {
font-size: 12px;
width: 25px;
}
&.cmb2-max-exceeded {
input[type="text"] {
border-color: $dark-red !important;
}
.cmb2-char-max-msg {
display: inline-block;
}
}
}
.cmb2-char-max-msg {
color: $dark-red;
display: none;
font-weight: 600;
margin-left: 1em;
}

View File

@@ -0,0 +1,56 @@
/*--------------------------------------------------------------
* Collapsible UI
--------------------------------------------------------------*/
.cmb2-metabox {
.cmbhandle {
color: $gray;
float: right;
width: 27px;
height: 30px;
cursor: pointer;
right: -1em;
position: relative;
&:before {
content: '\f142';
right: 12px;
font: normal 20px/1 'dashicons';
speak: none;
display: inline-block;
padding: 8px 10px;
top: 0;
position: relative;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-decoration: none !important;
}
}
.postbox.closed {
.cmbhandle {
&:before {
content: '\f140';
}
}
}
button.dashicons-before.dashicons-no-alt.cmb-remove-group-row {
-webkit-appearance: none !important;
background: none !important;
border: none !important;
position: absolute;
left: 0;
top: .5em;
line-height: 1em;
padding: 2px 6px 3px;
opacity: .5;
&:not([disabled]) {
cursor: pointer;
color: $dark-red;
opacity: 1;
&:hover {
color: $red;
}
}
}
}

View File

@@ -0,0 +1,111 @@
/*--------------------------------------------------------------
* Context Metaboxes
--------------------------------------------------------------*/
/* Metabox collapse arrow indicators */
.js .cmb2-postbox.context-box {
.handlediv {
text-align: center;
}
.toggle-indicator {
&:before {
content: "\f142";
display: inline-block;
font: normal 20px/1 dashicons;
speak: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-decoration: none !important;
}
}
&.closed {
.toggle-indicator {
&:before {
content: "\f140";
}
}
}
}
.cmb2-postbox.context-box {
margin-bottom: 10px;
&.context-before_permalink-box {
margin-top: 10px;
}
&.context-after_title-box {
margin-top: 10px;
}
&.context-after_editor-box {
margin-top: 20px;
margin-bottom: 0;
}
&.context-form_top-box {
margin-top: 10px;
.hndle {
font-size: 14px;
padding: 8px 12px;
margin: 0;
line-height: 1.4;
}
}
.hndle {
cursor: auto;
}
}
.cmb2-context-wrap {
margin-top: 10px;
&.cmb2-context-wrap-form_top {
margin-right: 300px;
width: auto;
}
&.cmb2-context-wrap-no-title {
.cmb2-metabox {
padding: 10px;
}
}
.cmb-th {
padding: 0 2% 0 0;
width: 18%;
}
.cmb-td {
width: 80%;
padding: 0;
}
.cmb-row {
margin-bottom: 10px;
&:last-of-type {
margin-bottom: 0;
}
}
}
/* one column on the post write/edit screen */
@media only screen and (max-width: 850px) {
.cmb2-context-wrap.cmb2-context-wrap-form_top {
margin-right: 0;
}
}

View File

@@ -0,0 +1,34 @@
/*--------------------------------------------------------------
* CMB2 Display Styling
--------------------------------------------------------------*/
.cmb2-colorpicker-swatch {
span {
display: inline-block;
width: 1em;
height: 1em;
border-radius: 1em;
float: left;
margin-top: 3px;
margin-right: 2px;
}
}
.cmb2-code {
overflow: scroll;
}
.cmb-image-display {
max-width: 100%;
height: auto;
}
.cmb2-display-file-list li {
display: inline;
margin: 0 .5em .5em 0;
}
.cmb2-oembed * {
max-width: 100%;
height: auto;
}

View File

@@ -0,0 +1,60 @@
/*--------------------------------------------------------------
* CMB2 Frontend
--------------------------------------------------------------*/
.closed .inside {
display: none;
}
.cmb-repeatable-grouping {
position: relative;
.cmb-group-title {
margin-left: -1em;
margin-right: -1em;
min-height: 1.5em;
}
h3 {
font-size: 14px;
padding: 8px 12px;
margin: 0;
line-height: 1.4;
}
}
.cmb-repeatable-group {
&.repeatable .cmb-group-title {
padding-left: 2.2em;
}
&.non-repeatable .cmb-group-title {
padding-left: 12px;
}
}
.cmb-type-group .cmb-row .cmbhandle {
right: 0;
position: absolute;
}
.cmb-spinner {
background: url(/wp-admin/images/spinner.gif) no-repeat;
-webkit-background-size: 20px 20px;
background-size: 20px 20px;
display: none;
float: right;
vertical-align: middle;
opacity: 0.7;
filter: alpha(opacity=70);
width: 20px;
height: 20px;
margin: 4px 10px 0;
}
.cmb2-char-max-msg {
display: none;
}

View File

@@ -0,0 +1,457 @@
/*
* jQuery UI CSS Framework 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*
* WordPress Styles adopted from "jQuery UI Datepicker CSS for WordPress"
* https://github.com/stuttter/wp-datepicker-styling
*
*/
* html .cmb2-element.ui-helper-clearfix {
height:1%;
}
$weekend: #f4f4f4;
$freshblue: #00a0d2;
$freshdark: #32373c;
$freshdarkblue: #0073aa;
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
padding: 0;
margin: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
background-color: #fff;
border: 1px solid #dfdfdf;
border-top: none;
-webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
min-width: 17em;
width: auto;
* {
padding: 0;
font-family: "Open Sans", sans-serif;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
table {
font-size: 13px;
margin: 0;
border: none;
border-collapse: collapse;
}
.ui-widget-header,
.ui-datepicker-header {
background-image: none;
border: none;
color: #fff;
font-weight: normal;
}
.ui-datepicker-header .ui-state-hover {
background: transparent;
border-color: transparent;
cursor: pointer;
}
.ui-datepicker-title {
margin: 0;
padding: 10px 0;
color: #fff;
font-size: 14px;
line-height: 14px;
text-align: center;
select {
margin-top: -8px;
margin-bottom: -8px;
}
}
.ui-datepicker-prev,
.ui-datepicker-next {
position: relative;
top: 0;
height: 34px;
width: 34px;
}
.ui-state-hover.ui-datepicker-prev,
.ui-state-hover.ui-datepicker-next {
border: none;
}
.ui-datepicker-prev,
.ui-datepicker-prev-hover {
left: 0;
}
.ui-datepicker-next,
.ui-datepicker-next-hover {
right: 0;
}
.ui-datepicker-next span,
.ui-datepicker-prev span {
display: none;
}
.ui-datepicker-prev {
float: left;
}
.ui-datepicker-next {
float: right;
}
.ui-datepicker-prev:before,
.ui-datepicker-next:before {
font: normal 20px/34px 'dashicons';
padding-left: 7px;
color: #fff;
speak: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
width: 34px;
height: 34px;
}
.ui-datepicker-prev:before {
content: '\f341';
}
.ui-datepicker-next:before {
content: '\f345';
}
.ui-datepicker-prev-hover:before,
.ui-datepicker-next-hover:before {
opacity: 0.7;
}
select.ui-datepicker-month,
select.ui-datepicker-year {
width: 33%;
background: transparent;
border-color: transparent;
box-shadow: none;
color: #fff;
option {
color: #333;
}
}
thead {
color: #fff;
font-weight: 600;
th {
font-weight: normal;
}
}
th {
padding: 10px;
}
td {
padding: 0;
border: 1px solid $weekend;
}
td.ui-datepicker-other-month {
border: transparent;
}
td.ui-datepicker-week-end {
background-color: $weekend;
border: 1px solid $weekend;
&.ui-datepicker-today {
-webkit-box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
}
}
td.ui-datepicker-today {
background-color: #f0f0c0;
}
td.ui-datepicker-current-day {
background: #bbdd88;
}
td .ui-state-default {
background: transparent;
border: none;
text-align: center;
text-decoration: none;
width: auto;
display: block;
padding: 5px 10px;
font-weight: normal;
color: #444;
}
td.ui-state-disabled .ui-state-default {
opacity: 0.5;
}
/* Default Color Scheme */
.ui-widget-header,
.ui-datepicker-header {
background: $freshblue;
}
thead {
background: $freshdark;
}
td .ui-state-hover, td .ui-state-active {
background: $freshdarkblue;
color: #fff;
}
.ui-timepicker-div {
font-size: 14px;
dl {
text-align: left;
padding: 0 .6em;
dt {
float: left;
clear:left;
padding: 0 0 0 5px;
}
dd {
margin: 0 10px 10px 40%;
select {
width: 100%;
}
}
}
+ .ui-datepicker-buttonpane {
padding: .6em;
text-align: left;
.button-primary, .button-secondary {
padding: 0 10px 1px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
margin: 0 .6em .4em .4em;
}
}
}
}
.admin-color-fresh {
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
.ui-widget-header,
.ui-datepicker-header {
background: $freshblue;
}
thead {
background: $freshdark;
}
td .ui-state-hover {
background: $freshdarkblue;
color: #fff;
}
}
}
.admin-color-blue {
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
.ui-widget-header,
.ui-datepicker-header {
background: #52accc;
}
thead {
background: #4796b3;
}
// td .ui-state-hover {
// background: #096484;
// }
td {
.ui-state-hover, .ui-state-active {
background: #096484;
color: #fff;
}
&.ui-datepicker-today {
background: #eee;
}
}
}
}
.admin-color-coffee {
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
.ui-widget-header,
.ui-datepicker-header {
background: #59524c;
}
thead {
background: #46403c;
}
td .ui-state-hover {
background: #c7a589;
color: #fff;
}
}
}
.admin-color-ectoplasm {
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
.ui-widget-header,
.ui-datepicker-header {
background: #523f6d;
}
thead {
background: #413256;
}
td .ui-state-hover {
background: #a3b745;
color: #fff;
}
}
}
.admin-color-midnight {
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
.ui-widget-header,
.ui-datepicker-header {
background: #363b3f;
}
thead {
background: #26292c;
}
td .ui-state-hover {
background: #e14d43;
color: #fff;
}
}
}
.admin-color-ocean {
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
.ui-widget-header,
.ui-datepicker-header {
background: #738e96;
}
thead {
background: #627c83;
}
td .ui-state-hover {
background: #9ebaa0;
color: #fff;
}
}
}
.admin-color-sunrise {
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
.ui-widget-header,
.ui-datepicker-header,
.ui-datepicker-header .ui-state-hover {
background: #cf4944;
}
th {
border-color: #be3631;
background: #be3631;
}
td .ui-state-hover {
background: #dd823b;
color: #fff;
}
}
}
.admin-color-light {
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
.ui-widget-header,
.ui-datepicker-header {
background: #e5e5e5;
}
select.ui-datepicker-month,
select.ui-datepicker-year {
color: #555;
}
thead {
background: #888;
}
.ui-datepicker-title,
td .ui-state-default,
.ui-datepicker-prev:before,
.ui-datepicker-next:before {
color: #555;
}
td {
.ui-state-hover, .ui-state-active {
background: #ccc;
}
&.ui-datepicker-today {
background: #eee;
}
}
}
}
.admin-color-bbp-evergreen {
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
.ui-widget-header,
.ui-datepicker-header {
background: #56b274;
}
thead {
background: #36533f;
}
td .ui-state-hover {
background: #446950;
color: #fff;
}
}
}
.admin-color-bbp-mint {
.cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
.ui-widget-header,
.ui-datepicker-header {
background: #4ca26a;
}
thead {
background: #4f6d59;
}
td .ui-state-hover {
background: #5fb37c;
color: #fff;
}
}
}

View File

@@ -0,0 +1,534 @@
/*--------------------------------------------------------------
* Main Wrap
--------------------------------------------------------------*/
.cmb2-wrap {
margin: 0;
input,
textarea {
max-width: 100%;
}
input[type="text"] {
&.cmb2-oembed {
width: 100%;
}
}
textarea {
width: 500px;
padding: 8px;
&.cmb2-textarea-code {
font-family: $font-mono;
line-height: 16px;
}
}
input {
&.cmb2-text-small,
&.cmb2-timepicker {
width: 100px;
// margin-right: 15px
}
&.cmb2-text-money {
width: 90px;
// margin-right: 15px
}
&.cmb2-text-medium {
width: 230px;
// margin-right: 15px
}
&.cmb2-upload-file {
width: 65%;
}
&.ed_button {
padding: 2px 4px;
}
&:not([type="hidden"]) {
+ input,
+ .button-secondary,
+ select {
margin-left: 20px;
}
}
}
ul {
margin: 0;
}
li {
font-size: $font-size;
line-height: 16px;
margin: 1px 0 5px 0;
}
// .cmb-field-list .cmb-field-list {
// padding-top:5px;
// margin: 0;
// }
select {
font-size: $font-size;
margin-top: 3px;
}
input:focus,
textarea:focus {
background: $light-yellow;
}
input[type="radio"] {
margin: 0 5px 0 0;
padding: 0;
}
input[type="checkbox"] {
margin: 0 5px 0 0;
padding: 0;
}
button,
.button-secondary {
white-space: nowrap;
}
.mceLayout {
border: 1px solid $light-gray !important;
}
.mceIframeContainer {
background: $white;
}
.meta_mce {
width: 97%;
textarea {
width: 100%;
}
}
// Multicheck toggle
.cmb-multicheck-toggle {
margin-top: -1em;
}
// Color picker
.wp-picker-clear.button,
.wp-picker-default.button {
margin-left: 6px;
padding: 2px 8px;
}
.cmb-row {
margin: 0;
&:after {
content: '';
clear: both;
display: block;
width: 100%;
}
&.cmb-repeat .cmb2-metabox-description {
padding-top: 0;
padding-bottom: 1em;
}
}
}
// Fixes bug created by 5.3+ block editor-specific styling
// Over-specific selector to override WordPress's over-specific selector without !important
// @todo - Remove when `body.branch-5-3` targeting 5.3+ is widely used
body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type="radio"]::before {
margin: .1875rem;
@media screen and (max-width: 782px) {
margin: .4375rem;
}
}
.cmb2-metabox {
clear: both;
margin: 0;
> .cmb-row:first-of-type >,
.cmb-field-list > .cmb-row:first-of-type > {
.cmb-td,
.cmb-th {
border: 0;
}
}
}
.cmb-add-row {
margin: 1.8em 0 0;
}
.cmb-nested .cmb-td,
.cmb-repeatable-group .cmb-th,
.cmb-repeatable-group:first-of-type {
border: 0;
}
.cmb-row:last-of-type,
.cmb2-wrap .cmb-row:last-of-type,
.cmb-repeatable-group:last-of-type {
border-bottom: 0;
}
.cmb-repeatable-grouping {
border: 1px solid $light-gray;
padding: 0 1em;
&.cmb-row {
margin: 0 0 0.8em;
}
+ .cmb-repeatable-grouping {
}
}
.cmb-th {
color: $dark-gray;
float: left;
font-weight: 600;
padding: 20px 10px 20px 0;
vertical-align: top;
width: 200px;
@media (max-width: $mobile-break) {
@include fullth;
}
}
.cmb-td {
line-height: 1.3;
max-width: 100%;
padding: 15px 10px;
vertical-align: middle;
}
.cmb-type-title {
.cmb-td {
padding: 0;
}
}
.cmb-th label {
display: block;
padding: 5px 0;
}
.cmb-th + .cmb-td {
float: left;
}
.cmb-td .cmb-td {
padding-bottom: 1em;
}
.cmb-remove-row {
text-align: right;
}
.empty-row.hidden {
display: none;
}
// Repeatable fields styles
.cmb-repeat-table {
background-color: $almostwhite;
border: 1px solid darken($light-gray, 3%);
.cmb-row.cmb-repeat-row {
position: relative;
counter-increment: el;
margin: 0;
padding: 10px 10px 10px 50px;
border-bottom: none !important; // Sometime, we need !important :).
& + .cmb-repeat-row {
border-top: solid 1px $light-gray;
}
&.ui-sortable-helper {
outline: dashed 2px $light-gray !important; // Sometime, we need !important :).
}
&:before {
content: counter(el);
display: block;
top: 0;
left: 0;
position: absolute;
width: 35px;
height: 100%;
line-height: 35px;
cursor: move;
color: $gray;
text-align: center;
border-right: solid 1px $light-gray;
}
.cmb-td {
margin: 0;
padding: 0;
}
}
+ .cmb-add-row {
margin: 0;
&:before {
content: '';
width: 1px;
height: 1.6em;
display: block;
margin-left: 17px;
background-color: darken($light-gray, 5%);
}
}
.cmb-remove-row {
top: 7px;
right: 7px;
position: absolute;
width: auto;
margin-left: 0;
padding: 0 !important; // Sometime, we need !important :).
display: none;
> .cmb-remove-row-button {
font-size: 20px;
text-indent: -1000px;
overflow: hidden;
position: relative;
height: auto;
line-height: 1;
padding: 0 10px 0;
&:before {
@include pseudo-dashicons("\f335");
line-height: 1.3;
}
}
}
.cmb-repeat-row:hover .cmb-remove-row {
display: block;
}
}
.cmb-repeatable-group {
.cmb-th {
padding: 5px;
}
.cmb-group-title {
background-color: $light-gray;
padding: 8px 12px 8px 2.2em;
margin: 0 -1em;
min-height: 1.5em;
font-size: 14px;
line-height: 1.4;
h4 {
border: 0;
margin: 0;
font-size: 1.2em;
font-weight: 500;
padding: 0.5em 0.75em;
}
.cmb-th {
display: block;
width: 100%;
}
}
.cmb-group-description .cmb-th {
@include fullth;
}
.cmb-shift-rows {
margin-right: 1em;
.dashicons-arrow-up-alt2 {
margin-top: .15em;
}
.dashicons-arrow-down-alt2 {
margin-top: .2em;
}
}
.cmb2-upload-button {
float: right;
}
}
p.cmb2-metabox-description {
color: $medium-gray;
letter-spacing: 0.01em;
margin: 0;
padding-top: .5em;
}
span.cmb2-metabox-description {
color: $medium-gray;
letter-spacing: 0.01em;
}
.cmb2-metabox-title {
margin: 0 0 5px 0;
padding: 5px 0 0 0;
font-size: 14px;
}
.cmb-inline ul {
padding: 4px 0 0 0;
}
.cmb-inline li {
display: inline-block;
padding-right: 18px;
}
.cmb-type-textarea-code pre {
margin: 0;
}
.cmb2-media-status {
.img-status {
clear: none;
display: inline-block;
vertical-align: middle;
margin-right: 10px;
width: auto;
img {
max-width: 350px;
height: auto;
}
}
.img-status img,
.embed-status {
background: $lightchecker;
border: 5px solid $white;
outline: 1px solid $light-gray;
box-shadow: inset 0 0 15px rgba( 0, 0, 0, 0.3 ), inset 0 0 0 1px rgba( 0, 0, 0, 0.05 );
background-image: linear-gradient(45deg, $darkchecker 25%, transparent 25%, transparent 75%, $darkchecker 75%, $darkchecker), linear-gradient(45deg, $darkchecker 25%, transparent 25%, transparent 75%, $darkchecker 75%, $darkchecker);
background-position: 0 0, 10px 10px;
background-size: 20px 20px;
border-radius: 2px;
-moz-border-radius: 2px;
margin: 15px 0 0 0;
}
.embed-status {
float: left;
max-width: 800px;
}
.img-status, .embed-status {
position: relative;
.cmb2-remove-file-button {
background: url(../images/ico-delete.png);
height: 16px;
left: -5px;
position: absolute;
text-indent: -9999px;
top: -5px;
width: 16px;
}
}
.img-status {
.cmb2-remove-file-button {
top: 10px;
}
}
.img-status img, .file-status > span {
cursor: pointer;
}
&.cmb-attach-list {
.img-status img, .file-status > span {
cursor: move;
}
}
}
.cmb-type-file-list .cmb2-media-status .img-status {
clear: none;
vertical-align: middle;
width: auto;
margin-right: 10px;
margin-bottom: 10px;
margin-top: 0;
}
.cmb-attach-list li {
clear: both;
display: inline-block;
width: 100%;
margin-top: 5px;
margin-bottom: 10px;
img {
float: left;
margin-right: 10px;
}
}
.cmb2-remove-wrapper {
margin: 0;
}
.child-cmb2 .cmb-th {
text-align: left;
}
.cmb2-indented-hierarchy {
padding-left: 1.5em;
}
@media (max-width: $mobile-break) {
.cmb-th,
.cmb-td,
.cmb-th + .cmb-td {
display: block;
float: none;
width: 100%;
}
}

View File

@@ -0,0 +1,29 @@
/*--------------------------------------------------------------
* Misc.
--------------------------------------------------------------*/
#poststuff .cmb-repeatable-group h2 {
margin: 0;
}
.edit-tags-php,
.profile-php,
.user-edit-php {
.cmb2-metabox-title {
font-size: 1.4em;
}
}
.cmb2-postbox, .cmb2-no-box-wrap {
.cmb-spinner {
float: left;
display: none;
}
}
.cmb-spinner {
display: none;
&.is-active {
display: block;
}
}

View File

@@ -0,0 +1,51 @@
//--------------------------------------------------------------
// Mixins
//--------------------------------------------------------------
@mixin fullth() {
font-size: 1.2em;
@include _fullth;
}
@mixin fullth_side() {
@include _fullth;
label {
font-size: $font-size;
line-height: 1.4em;
}
}
@mixin _fullth() {
display: block;
float: none;
padding-bottom: 1em;
text-align: left;
width: 100%;
label {
display: block;
margin-top: 0;
margin-bottom: 0.5em;
}
}
@mixin pseudo-dashicons( $glyph: "\f333" ) {
content: $glyph;
font-family: 'Dashicons';
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
margin: 0;
text-indent: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: center;
}

View File

@@ -0,0 +1,31 @@
/*--------------------------------------------------------------
* New-Term Page
--------------------------------------------------------------*/
#addtag {
.cmb-th {
float: none;
width: auto;
padding: 20px 0 0;
}
.cmb-td {
padding: 0;
}
.cmb-th + .cmb-td {
float: none;
}
select {
max-width: 100%;
}
.cmb2-metabox {
padding-bottom: 20px;
}
.cmb-row li label {
display: inline;
}
}

View File

@@ -0,0 +1,71 @@
/*--------------------------------------------------------------
* Options page
--------------------------------------------------------------*/
.cmb2-options-page {
max-width: 1200px;
&.wrap > h2 {
margin-bottom: 1em;
}
.cmb2-metabox > .cmb-row {
padding: 1em;
margin-top: -1px;
background: $white;
border: 1px solid $light-gray;
box-shadow: 0 1px 1px rgba(black, 0.05);
> .cmb-th {
padding: 0;
font-weight: initial;
}
> .cmb-th + .cmb-td {
float: none;
padding: 0 0 0 1em;
margin-left: 200px;
@media (max-width: $mobile-break) {
padding: 0;
margin-left: 0;
}
}
}
// Title field style.
.cmb2-wrap .cmb-type-title {
margin-top: 1em;
padding: 0.6em 1em;
background-color: $almostwhite;
.cmb2-metabox-title {
font-size: 12px;
margin-top: 0;
margin-bottom: 0;
text-transform: uppercase;
}
.cmb2-metabox-description {
padding-top: 0.25em;
}
}
.cmb-repeatable-group {
.cmb-group-description .cmb-th {
padding: 0 0 0.8em 0;
}
.cmb-group-name {
font-size: 16px;
margin-top: 0;
margin-bottom: 0;
}
.cmb-th > .cmb2-metabox-description {
font-weight: 400;
padding-bottom: 0 !important;
}
}
}

View File

@@ -0,0 +1,99 @@
/*--------------------------------------------------------------
* Post Metaboxes
--------------------------------------------------------------*/
#poststuff .cmb-group-title {
margin-left: -1em;
margin-right: -1em;
min-height: 1.5em;
}
#poststuff .repeatable .cmb-group-title {
padding-left: 2.2em;
}
.cmb2-postbox, .cmb-type-group {
.cmb2-wrap {
margin: 0;
> .cmb-field-list > .cmb-row {
padding: 1.8em 0;
}
input[type=text] {
&.cmb2-oembed {
width: 100%;
}
}
}
.cmb-row {
padding: 0 0 1.8em;
margin: 0 0 0.8em;
.cmbhandle {
right: -1em;
position: relative;
color: $dark-gray;
}
}
.cmb-repeatable-grouping {
padding: 0 1em;
max-width: 100%;
min-width: 1px !important;
}
.cmb-repeatable-group > .cmb-row {
padding-bottom: 0;
}
.cmb-th {
width: 18%;
padding: 0 2% 0 0;
// text-align: right;
}
.cmb-td {
margin-bottom: 0;
padding: 0;
line-height: 1.3;
}
.cmb-th + .cmb-td {
width: 80%;
float: right;
}
.cmb-row:not(:last-of-type),
.cmb-repeatable-group:not(:last-of-type) {
border-bottom: 1px solid $light-gray;
@media (max-width: $mobile-break) {
border-bottom: 0;
}
}
.cmb-repeat-group-field,
.cmb-remove-field-row {
padding-top: 1.8em;
}
.button-secondary {
.dashicons {
line-height: 1.3;
}
&.move-up, &.move-down {
.dashicons {
line-height: 1.1;
}
}
&.cmb-add-group-row {
.dashicons {
line-height: 1.5;
}
}
}
}

View File

@@ -0,0 +1,146 @@
/*--------------------------------------------------------------
* Sidebar Placement Adjustments
--------------------------------------------------------------*/
.inner-sidebar,
#side-sortables {
.cmb2-wrap {
> .cmb-field-list > .cmb-row {
padding: 1.4em 0;
}
input {
&[type=text]:not( .wp-color-picker ) {
width: 100%;
}
+ input:not( .wp-picker-clear ), + select {
margin-left: 0;
margin-top: 1em;
display: block;
}
&.cmb2-text-money {
max-width: 70%;
+ .cmb2-metabox-description {
display: block;
}
}
}
label {
display: block;
font-weight: 700;
padding: 0 0 5px;
}
}
textarea {
max-width: 99%;
}
.cmb-repeatable-group {
border-bottom: 1px solid $light-gray;
}
.cmb-type-group > .cmb-td > .cmb-repeatable-group {
border-bottom: 0;
margin-bottom: -1.4em;
}
.cmb-th,
.cmb-td:not(.cmb-remove-row),
.cmb-th + .cmb-td {
width: 100%;
display: block;
float: none;
}
.closed .inside {
display: none;
}
.cmb-th {
@include fullth_side;
padding-left: 0;
padding-right: 0;
}
.cmb-group-description {
.cmb-th {
padding-top: 0;
}
.cmb2-metabox-description {
padding: 0;
}
}
.cmb-group-title {
// padding-bottom: 0;
.cmb-th {
padding: 0;
}
}
.cmb-repeatable-grouping {
+ .cmb-repeatable-grouping {
margin-top: 1em;
}
}
.cmb2-media-status {
.img-status,
.embed-status {
img {
max-width: 90%;
// width: auto;
height: auto;
}
}
}
.cmb2-list label {
display: inline;
font-weight: normal;
}
.cmb2-metabox-description {
display: block;
padding: 7px 0 0;
}
.cmb-type-checkbox {
.cmb-td label,
.cmb2-metabox-description {
font-weight: normal;
display: inline;
}
}
.cmb-row .cmb2-metabox-description {
padding-bottom: 1.8em;
}
.cmb2-metabox-title {
font-size: 1.2em;
font-style: italic;
}
.cmb-remove-row {
clear: both;
padding-top: 12px;
padding-bottom: 0;
}
.cmb2-upload-button {
clear: both;
margin-top: 12px;
}
}

View File

@@ -0,0 +1,26 @@
//--------------------------------------------------------------
// Variables
//--------------------------------------------------------------
// Mobile break-point
$mobile-break : 450px;
// Fonts
$font-sans : sans-serif;
$font-serif : Georgia, Times, "Times New Roman", serif;
$font-mono : "Courier 10 Pitch", Courier, monospace;
$font-size : 14px;
// Colors
$dark-gray : #222222;
$gray : #757575;
$medium-gray : #666;
$light-gray : #e9e9e9;
$lightchecker : #eee;
$darkchecker : #d0d0d0;
$blue : #0063ce;
$light-yellow : #fffff8;
$white : #ffffff;
$almostwhite : #fafafa;
$red : #f00;
$dark-red : #a00;

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden

View File

@@ -0,0 +1,807 @@
<?php
/**
* Include and setup custom metaboxes and fields. (make sure you copy this file to outside the CMB2 directory)
*
* Be sure to replace all instances of 'yourprefix_' with your project's prefix.
* http://nacin.com/2010/05/11/in-wordpress-prefix-everything/
*
* @category YourThemeOrPlugin
* @package Demo_CMB2
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
* @link https://github.com/CMB2/CMB2
*/
/**
* Get the bootstrap! If using the plugin from wordpress.org, REMOVE THIS!
*/
if ( file_exists( dirname( __FILE__ ) . '/cmb2/init.php' ) ) {
require_once dirname( __FILE__ ) . '/cmb2/init.php';
} elseif ( file_exists( dirname( __FILE__ ) . '/CMB2/init.php' ) ) {
require_once dirname( __FILE__ ) . '/CMB2/init.php';
}
/**
* Conditionally displays a metabox when used as a callback in the 'show_on_cb' cmb2_box parameter
*
* @param CMB2 $cmb CMB2 object.
*
* @return bool True if metabox should show
*/
function yourprefix_show_if_front_page( $cmb ) {
// Don't show this metabox if it's not the front page template.
if ( get_option( 'page_on_front' ) !== $cmb->object_id ) {
return false;
}
return true;
}
/**
* Conditionally displays a field when used as a callback in the 'show_on_cb' field parameter
*
* @param CMB2_Field $field Field object.
*
* @return bool True if metabox should show
*/
function yourprefix_hide_if_no_cats( $field ) {
// Don't show this field if not in the cats category.
if ( ! has_tag( 'cats', $field->object_id ) ) {
return false;
}
return true;
}
/**
* Manually render a field.
*
* @param array $field_args Array of field arguments.
* @param CMB2_Field $field The field object.
*/
function yourprefix_render_row_cb( $field_args, $field ) {
$classes = $field->row_classes();
$id = $field->args( 'id' );
$label = $field->args( 'name' );
$name = $field->args( '_name' );
$value = $field->escaped_value();
$description = $field->args( 'description' );
?>
<div class="custom-field-row <?php echo esc_attr( $classes ); ?>">
<p><label for="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $label ); ?></label></p>
<p><input id="<?php echo esc_attr( $id ); ?>" type="text" name="<?php echo esc_attr( $name ); ?>" value="<?php echo $value; ?>"/></p>
<p class="description"><?php echo esc_html( $description ); ?></p>
</div>
<?php
}
/**
* Manually render a field column display.
*
* @param array $field_args Array of field arguments.
* @param CMB2_Field $field The field object.
*/
function yourprefix_display_text_small_column( $field_args, $field ) {
?>
<div class="custom-column-display <?php echo esc_attr( $field->row_classes() ); ?>">
<p><?php echo $field->escaped_value(); ?></p>
<p class="description"><?php echo esc_html( $field->args( 'description' ) ); ?></p>
</div>
<?php
}
/**
* Conditionally displays a message if the $post_id is 2
*
* @param array $field_args Array of field parameters.
* @param CMB2_Field $field Field object.
*/
function yourprefix_before_row_if_2( $field_args, $field ) {
if ( 2 == $field->object_id ) {
echo '<p>Testing <b>"before_row"</b> parameter (on $post_id 2)</p>';
} else {
echo '<p>Testing <b>"before_row"</b> parameter (<b>NOT</b> on $post_id 2)</p>';
}
}
add_action( 'cmb2_admin_init', 'yourprefix_register_demo_metabox' );
/**
* Hook in and add a demo metabox. Can only happen on the 'cmb2_admin_init' or 'cmb2_init' hook.
*/
function yourprefix_register_demo_metabox() {
/**
* Sample metabox to demonstrate each field type included
*/
$cmb_demo = new_cmb2_box( array(
'id' => 'yourprefix_demo_metabox',
'title' => esc_html__( 'Test Metabox', 'cmb2' ),
'object_types' => array( 'page' ), // Post type
// 'show_on_cb' => 'yourprefix_show_if_front_page', // function should return a bool value
// 'context' => 'normal',
// 'priority' => 'high',
// 'show_names' => true, // Show field names on the left
// 'cmb_styles' => false, // false to disable the CMB stylesheet
// 'closed' => true, // true to keep the metabox closed by default
// 'classes' => 'extra-class', // Extra cmb2-wrap classes
// 'classes_cb' => 'yourprefix_add_some_classes', // Add classes through a callback.
/*
* The following parameter is any additional arguments passed as $callback_args
* to add_meta_box, if/when applicable.
*
* CMB2 does not use these arguments in the add_meta_box callback, however, these args
* are parsed for certain special properties, like determining Gutenberg/block-editor
* compatibility.
*
* Examples:
*
* - Make sure default editor is used as metabox is not compatible with block editor
* [ '__block_editor_compatible_meta_box' => false/true ]
*
* - Or declare this box exists for backwards compatibility
* [ '__back_compat_meta_box' => false ]
*
* More: https://wordpress.org/gutenberg/handbook/extensibility/meta-box/
*/
// 'mb_callback_args' => array( '__block_editor_compatible_meta_box' => false ),
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Text', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_text',
'type' => 'text',
'show_on_cb' => 'yourprefix_hide_if_no_cats', // function should return a bool value
// 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter
// 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter
// 'on_front' => false, // Optionally designate a field to wp-admin only
// 'repeatable' => true,
// 'column' => true, // Display field value in the admin post-listing columns
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Text Small', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_textsmall',
'type' => 'text_small',
// 'repeatable' => true,
// 'column' => array(
// 'name' => esc_html__( 'Column Title', 'cmb2' ), // Set the admin column title
// 'position' => 2, // Set as the second column.
// );
// 'display_cb' => 'yourprefix_display_text_small_column', // Output the display of the column values through a callback.
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Text Medium', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_textmedium',
'type' => 'text_medium',
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Read-only Disabled Field', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_readonly',
'type' => 'text_medium',
'default' => esc_attr__( 'Hey there, I\'m a read-only field', 'cmb2' ),
'save_field' => false, // Disables the saving of this field.
'attributes' => array(
'disabled' => 'disabled',
'readonly' => 'readonly',
),
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Custom Rendered Field', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_render_row_cb',
'type' => 'text',
'render_row_cb' => 'yourprefix_render_row_cb',
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Website URL', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_url',
'type' => 'text_url',
// 'protocols' => array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'), // Array of allowed protocols
// 'repeatable' => true,
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Text Email', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_email',
'type' => 'text_email',
// 'repeatable' => true,
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Time', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_time',
'type' => 'text_time',
// 'time_format' => 'H:i', // Set to 24hr format
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Time zone', 'cmb2' ),
'desc' => esc_html__( 'Time zone', 'cmb2' ),
'id' => 'yourprefix_demo_timezone',
'type' => 'select_timezone',
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Date Picker', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_textdate',
'type' => 'text_date',
// 'date_format' => 'Y-m-d',
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Date Picker (UNIX timestamp)', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_textdate_timestamp',
'type' => 'text_date_timestamp',
// 'timezone_meta_key' => 'yourprefix_demo_timezone', // Optionally make this field honor the timezone selected in the select_timezone specified above
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Date/Time Picker Combo (UNIX timestamp)', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_datetime_timestamp',
'type' => 'text_datetime_timestamp',
) );
// This text_datetime_timestamp_timezone field type
// is only compatible with PHP versions 5.3 or above.
// Feel free to uncomment and use if your server meets the requirement
// $cmb_demo->add_field( array(
// 'name' => esc_html__( 'Test Date/Time Picker/Time zone Combo (serialized DateTime object)', 'cmb2' ),
// 'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
// 'id' => 'yourprefix_demo_datetime_timestamp_timezone',
// 'type' => 'text_datetime_timestamp_timezone',
// ) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Money', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_textmoney',
'type' => 'text_money',
// 'before_field' => '£', // override '$' symbol if needed
// 'repeatable' => true,
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Color Picker', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_colorpicker',
'type' => 'colorpicker',
'default' => '#ffffff',
// 'options' => array(
// 'alpha' => true, // Make this a rgba color picker.
// ),
// 'attributes' => array(
// 'data-colorpicker' => json_encode( array(
// 'palettes' => array( '#3dd0cc', '#ff834c', '#4fa2c0', '#0bc991', ),
// ) ),
// ),
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Text Area', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_textarea',
'type' => 'textarea',
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Text Area Small', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_textareasmall',
'type' => 'textarea_small',
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Text Area for Code', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_textarea_code',
'type' => 'textarea_code',
// 'attributes' => array(
// // Optionally override the code editor defaults.
// 'data-codeeditor' => json_encode( array(
// 'codemirror' => array(
// 'lineNumbers' => false,
// 'mode' => 'css',
// ),
// ) ),
// ),
// To keep the previous formatting, you can disable codemirror.
// 'options' => array( 'disable_codemirror' => true ),
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Title Weeeee', 'cmb2' ),
'desc' => esc_html__( 'This is a title description', 'cmb2' ),
'id' => 'yourprefix_demo_title',
'type' => 'title',
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Select', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_select',
'type' => 'select',
'show_option_none' => true,
'options' => array(
'standard' => esc_html__( 'Option One', 'cmb2' ),
'custom' => esc_html__( 'Option Two', 'cmb2' ),
'none' => esc_html__( 'Option Three', 'cmb2' ),
),
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Radio inline', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_radio_inline',
'type' => 'radio_inline',
'show_option_none' => 'No Selection',
'options' => array(
'standard' => esc_html__( 'Option One', 'cmb2' ),
'custom' => esc_html__( 'Option Two', 'cmb2' ),
'none' => esc_html__( 'Option Three', 'cmb2' ),
),
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Radio', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_radio',
'type' => 'radio',
'options' => array(
'option1' => esc_html__( 'Option One', 'cmb2' ),
'option2' => esc_html__( 'Option Two', 'cmb2' ),
'option3' => esc_html__( 'Option Three', 'cmb2' ),
),
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Taxonomy Radio', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_text_taxonomy_radio',
'type' => 'taxonomy_radio', // Or `taxonomy_radio_inline`/`taxonomy_radio_hierarchical`
'taxonomy' => 'category', // Taxonomy Slug
// 'inline' => true, // Toggles display to inline
// Optionally override the args sent to the WordPress get_terms function.
'query_args' => array(
// 'orderby' => 'slug',
// 'hide_empty' => true,
),
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Taxonomy Select', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_taxonomy_select',
'type' => 'taxonomy_select', // Or `taxonomy_select_hierarchical`
'taxonomy' => 'category', // Taxonomy Slug
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Taxonomy Multi Checkbox', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_multitaxonomy',
'type' => 'taxonomy_multicheck', // Or `taxonomy_multicheck_inline`/`taxonomy_multicheck_hierarchical`
'taxonomy' => 'post_tag', // Taxonomy Slug
// 'inline' => true, // Toggles display to inline
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Checkbox', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_checkbox',
'type' => 'checkbox',
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Multi Checkbox', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_multicheckbox',
'type' => 'multicheck',
// 'multiple' => true, // Store values in individual rows
'options' => array(
'check1' => esc_html__( 'Check One', 'cmb2' ),
'check2' => esc_html__( 'Check Two', 'cmb2' ),
'check3' => esc_html__( 'Check Three', 'cmb2' ),
),
// 'inline' => true, // Toggles display to inline
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test wysiwyg', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_demo_wysiwyg',
'type' => 'wysiwyg',
'options' => array(
'textarea_rows' => 5,
),
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Image', 'cmb2' ),
'desc' => esc_html__( 'Upload an image or enter a URL.', 'cmb2' ),
'id' => 'yourprefix_demo_image',
'type' => 'file',
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'Multiple Files', 'cmb2' ),
'desc' => esc_html__( 'Upload or add multiple images/attachments.', 'cmb2' ),
'id' => 'yourprefix_demo_file_list',
'type' => 'file_list',
'preview_size' => array( 100, 100 ), // Default: array( 50, 50 )
) );
$cmb_demo->add_field( array(
'name' => esc_html__( 'oEmbed', 'cmb2' ),
'desc' => sprintf(
/* translators: %s: link to codex.wordpress.org/Embeds */
esc_html__( 'Enter a youtube, twitter, or instagram URL. Supports services listed at %s.', 'cmb2' ),
'<a href="https://wordpress.org/support/article/embeds/">codex.wordpress.org/Embeds</a>'
),
'id' => 'yourprefix_demo_embed',
'type' => 'oembed',
) );
$cmb_demo->add_field( array(
'name' => 'Testing Field Parameters',
'id' => 'yourprefix_demo_parameters',
'type' => 'text',
'before_row' => 'yourprefix_before_row_if_2', // callback.
'before' => '<p>Testing <b>"before"</b> parameter</p>',
'before_field' => '<p>Testing <b>"before_field"</b> parameter</p>',
'after_field' => '<p>Testing <b>"after_field"</b> parameter</p>',
'after' => '<p>Testing <b>"after"</b> parameter</p>',
'after_row' => '<p>Testing <b>"after_row"</b> parameter</p>',
) );
}
add_action( 'cmb2_admin_init', 'yourprefix_register_about_page_metabox' );
/**
* Hook in and add a metabox that only appears on the 'About' page
*/
function yourprefix_register_about_page_metabox() {
/**
* Metabox to be displayed on a single page ID
*/
$cmb_about_page = new_cmb2_box( array(
'id' => 'yourprefix_about_metabox',
'title' => esc_html__( 'About Page Metabox', 'cmb2' ),
'object_types' => array( 'page' ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
'show_on' => array(
'id' => array( 2 ),
), // Specific post IDs to display this metabox
) );
$cmb_about_page->add_field( array(
'name' => esc_html__( 'Test Text', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_about_text',
'type' => 'text',
) );
}
add_action( 'cmb2_admin_init', 'yourprefix_register_repeatable_group_field_metabox' );
/**
* Hook in and add a metabox to demonstrate repeatable grouped fields
*/
function yourprefix_register_repeatable_group_field_metabox() {
/**
* Repeatable Field Groups
*/
$cmb_group = new_cmb2_box( array(
'id' => 'yourprefix_group_metabox',
'title' => esc_html__( 'Repeating Field Group', 'cmb2' ),
'object_types' => array( 'page' ),
) );
// $group_field_id is the field id string, so in this case: 'yourprefix_group_demo'
$group_field_id = $cmb_group->add_field( array(
'id' => 'yourprefix_group_demo',
'type' => 'group',
'description' => esc_html__( 'Generates reusable form entries', 'cmb2' ),
'options' => array(
'group_title' => esc_html__( 'Entry {#}', 'cmb2' ), // {#} gets replaced by row number
'add_button' => esc_html__( 'Add Another Entry', 'cmb2' ),
'remove_button' => esc_html__( 'Remove Entry', 'cmb2' ),
'sortable' => true,
// 'closed' => true, // true to have the groups closed by default
// 'remove_confirm' => esc_html__( 'Are you sure you want to remove?', 'cmb2' ), // Performs confirmation before removing group.
),
) );
/**
* Group fields works the same, except ids only need
* to be unique to the group. Prefix is not needed.
*
* The parent field's id needs to be passed as the first argument.
*/
$cmb_group->add_group_field( $group_field_id, array(
'name' => esc_html__( 'Entry Title', 'cmb2' ),
'id' => 'title',
'type' => 'text',
// 'repeatable' => true, // Repeatable fields are supported w/in repeatable groups (for most types)
) );
$cmb_group->add_group_field( $group_field_id, array(
'name' => esc_html__( 'Description', 'cmb2' ),
'description' => esc_html__( 'Write a short description for this entry', 'cmb2' ),
'id' => 'description',
'type' => 'textarea_small',
) );
$cmb_group->add_group_field( $group_field_id, array(
'name' => esc_html__( 'Entry Image', 'cmb2' ),
'id' => 'image',
'type' => 'file',
) );
$cmb_group->add_group_field( $group_field_id, array(
'name' => esc_html__( 'Image Caption', 'cmb2' ),
'id' => 'image_caption',
'type' => 'text',
) );
}
add_action( 'cmb2_admin_init', 'yourprefix_register_user_profile_metabox' );
/**
* Hook in and add a metabox to add fields to the user profile pages
*/
function yourprefix_register_user_profile_metabox() {
/**
* Metabox for the user profile screen
*/
$cmb_user = new_cmb2_box( array(
'id' => 'yourprefix_user_edit',
'title' => esc_html__( 'User Profile Metabox', 'cmb2' ), // Doesn't output for user boxes
'object_types' => array( 'user' ), // Tells CMB2 to use user_meta vs post_meta
'show_names' => true,
'new_user_section' => 'add-new-user', // where form will show on new user page. 'add-existing-user' is only other valid option.
) );
$cmb_user->add_field( array(
'name' => esc_html__( 'Extra Info', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_user_extra_info',
'type' => 'title',
'on_front' => false,
) );
$cmb_user->add_field( array(
'name' => esc_html__( 'Avatar', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_user_avatar',
'type' => 'file',
) );
$cmb_user->add_field( array(
'name' => esc_html__( 'Facebook URL', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_user_facebookurl',
'type' => 'text_url',
) );
$cmb_user->add_field( array(
'name' => esc_html__( 'Twitter URL', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_user_twitterurl',
'type' => 'text_url',
) );
$cmb_user->add_field( array(
'name' => esc_html__( 'Google+ URL', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_user_googleplusurl',
'type' => 'text_url',
) );
$cmb_user->add_field( array(
'name' => esc_html__( 'Linkedin URL', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_user_linkedinurl',
'type' => 'text_url',
) );
$cmb_user->add_field( array(
'name' => esc_html__( 'User Field', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_user_user_text_field',
'type' => 'text',
) );
}
add_action( 'cmb2_admin_init', 'yourprefix_register_taxonomy_metabox' );
/**
* Hook in and add a metabox to add fields to taxonomy terms
*/
function yourprefix_register_taxonomy_metabox() {
/**
* Metabox to add fields to categories and tags
*/
$cmb_term = new_cmb2_box( array(
'id' => 'yourprefix_term_edit',
'title' => esc_html__( 'Category Metabox', 'cmb2' ), // Doesn't output for term boxes
'object_types' => array( 'term' ), // Tells CMB2 to use term_meta vs post_meta
'taxonomies' => array( 'category', 'post_tag' ), // Tells CMB2 which taxonomies should have these fields
// 'new_term_section' => true, // Will display in the "Add New Category" section
) );
$cmb_term->add_field( array(
'name' => esc_html__( 'Extra Info', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_term_extra_info',
'type' => 'title',
'on_front' => false,
) );
$cmb_term->add_field( array(
'name' => esc_html__( 'Term Image', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_term_avatar',
'type' => 'file',
) );
$cmb_term->add_field( array(
'name' => esc_html__( 'Arbitrary Term Field', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'yourprefix_term_term_text_field',
'type' => 'text',
) );
}
add_action( 'cmb2_admin_init', 'yourprefix_register_theme_options_metabox' );
/**
* Hook in and register a metabox to handle a theme options page and adds a menu item.
*/
function yourprefix_register_theme_options_metabox() {
/**
* Registers options page menu item and form.
*/
$cmb_options = new_cmb2_box( array(
'id' => 'yourprefix_theme_options_page',
'title' => esc_html__( 'Theme Options', 'cmb2' ),
'object_types' => array( 'options-page' ),
/*
* The following parameters are specific to the options-page box
* Several of these parameters are passed along to add_menu_page()/add_submenu_page().
*/
'option_key' => 'yourprefix_theme_options', // The option key and admin menu page slug.
'icon_url' => 'dashicons-palmtree', // Menu icon. Only applicable if 'parent_slug' is left empty.
// 'menu_title' => esc_html__( 'Options', 'cmb2' ), // Falls back to 'title' (above).
// 'parent_slug' => 'themes.php', // Make options page a submenu item of the themes menu.
// 'capability' => 'manage_options', // Cap required to view options-page.
// 'position' => 1, // Menu position. Only applicable if 'parent_slug' is left empty.
// 'admin_menu_hook' => 'network_admin_menu', // 'network_admin_menu' to add network-level options page.
// 'priority' => 10, // Define the page-registration admin menu hook priority.
// 'display_cb' => false, // Override the options-page form output (CMB2_Hookup::options_page_output()).
// 'save_button' => esc_html__( 'Save Theme Options', 'cmb2' ), // The text for the options-page save button. Defaults to 'Save'.
// 'disable_settings_errors' => true, // On settings pages (not options-general.php sub-pages), allows disabling.
// 'message_cb' => 'yourprefix_options_page_message_callback',
// 'tab_group' => '', // Tab-group identifier, enables options page tab navigation.
// 'tab_title' => null, // Falls back to 'title' (above).
// 'autoload' => false, // Defaults to true, the options-page option will be autloaded.
) );
/**
* Options fields ids only need
* to be unique within this box.
* Prefix is not needed.
*/
$cmb_options->add_field( array(
'name' => esc_html__( 'Site Background Color', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => 'bg_color',
'type' => 'colorpicker',
'default' => '#ffffff',
) );
}
/**
* Callback to define the optionss-saved message.
*
* @param CMB2 $cmb The CMB2 object.
* @param array $args {
* An array of message arguments
*
* @type bool $is_options_page Whether current page is this options page.
* @type bool $should_notify Whether options were saved and we should be notified.
* @type bool $is_updated Whether options were updated with save (or stayed the same).
* @type string $setting For add_settings_error(), Slug title of the setting to which
* this error applies.
* @type string $code For add_settings_error(), Slug-name to identify the error.
* Used as part of 'id' attribute in HTML output.
* @type string $message For add_settings_error(), The formatted message text to display
* to the user (will be shown inside styled `<div>` and `<p>` tags).
* Will be 'Settings updated.' if $is_updated is true, else 'Nothing to update.'
* @type string $type For add_settings_error(), Message type, controls HTML class.
* Accepts 'error', 'updated', '', 'notice-warning', etc.
* Will be 'updated' if $is_updated is true, else 'notice-warning'.
* }
*/
function yourprefix_options_page_message_callback( $cmb, $args ) {
if ( ! empty( $args['should_notify'] ) ) {
if ( $args['is_updated'] ) {
// Modify the updated message.
$args['message'] = sprintf( esc_html__( '%s &mdash; Updated!', 'cmb2' ), $cmb->prop( 'title' ) );
}
add_settings_error( $args['setting'], $args['code'], $args['message'], $args['type'] );
}
}
/**
* Only show this box in the CMB2 REST API if the user is logged in.
*
* @param bool $is_allowed Whether this box and its fields are allowed to be viewed.
* @param CMB2_REST_Controller $cmb_controller The controller object.
* CMB2 object available via `$cmb_controller->rest_box->cmb`.
*
* @return bool Whether this box and its fields are allowed to be viewed.
*/
function yourprefix_limit_rest_view_to_logged_in_users( $is_allowed, $cmb_controller ) {
if ( ! is_user_logged_in() ) {
$is_allowed = false;
}
return $is_allowed;
}
add_action( 'cmb2_init', 'yourprefix_register_rest_api_box' );
/**
* Hook in and add a box to be available in the CMB2 REST API. Can only happen on the 'cmb2_init' hook.
* More info: https://github.com/CMB2/CMB2/wiki/REST-API
*/
function yourprefix_register_rest_api_box() {
$cmb_rest = new_cmb2_box( array(
'id' => 'yourprefix_rest_metabox',
'title' => esc_html__( 'REST Test Box', 'cmb2' ),
'object_types' => array( 'page' ), // Post type
'show_in_rest' => WP_REST_Server::ALLMETHODS, // WP_REST_Server::READABLE|WP_REST_Server::EDITABLE, // Determines which HTTP methods the box is visible in.
// Optional callback to limit box visibility.
// See: https://github.com/CMB2/CMB2/wiki/REST-API#permissions
// 'get_box_permissions_check_cb' => 'yourprefix_limit_rest_view_to_logged_in_users',
) );
$cmb_rest->add_field( array(
'name' => esc_html__( 'REST Test Text', 'cmb2' ),
'desc' => esc_html__( 'Will show in the REST API for this box and for pages.', 'cmb2' ),
'id' => 'yourprefix_rest_text',
'type' => 'text',
) );
$cmb_rest->add_field( array(
'name' => esc_html__( 'REST Editable Test Text', 'cmb2' ),
'desc' => esc_html__( 'Will show in REST API "editable" contexts only (`POST` requests).', 'cmb2' ),
'id' => 'yourprefix_rest_editable_text',
'type' => 'text',
'show_in_rest' => WP_REST_Server::EDITABLE,// WP_REST_Server::ALLMETHODS|WP_REST_Server::READABLE, // Determines which HTTP methods the field is visible in. Will override the cmb2_box 'show_in_rest' param.
) );
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Some files were not shown because too many files have changed in this diff Show More