` 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), ([#616](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/616)).
* 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
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 `` 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 displayed. 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 memory 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 :)
== Upgrade Notice ==
### 2.10.1
#### Bug Fixes
* Fix issue with date picker formatting. Fixes [#1448](https://github.com/CMB2/CMB2/issues/1448).
### 2.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
#### 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
#### 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
#### 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.
/**
* Internal dependencies
*/
import { AddToCartFormStateContextProvider } from '../form-state';
import FormSubmit from './submit';
/**
* Add to cart form provider.
*
* This wraps the add to cart form and provides an api interface for children via various hooks.
*
* @param {Object} props Incoming props for the provider.
* @param {Object} props.children The children being wrapped.
* @param {Object} [props.product] The product for which the form belongs to.
* @param {boolean} [props.showFormElements] Should form elements be shown.
*/
export const AddToCartFormContextProvider = ( {
children,
product,
showFormElements,
} ) => {
return (
{ children }
);
};
import{proxyCustomElement,HTMLElement,createEvent,h}from"@stencil/core/internal/client";const prestoMutedOverlayCss=":host{display:block}",PrestoMutedOverlayStyle0=prestoMutedOverlayCss,PrestoMutedOverlay=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.playVideo=createEvent(this,"playVideo",7),this.mutedPreview=void 0,this.mutedOverlay=void 0,this.preset=void 0}render(){var e,t,l,r,a,o,s,d,i;return h("div",{key:"d65899750134c7f2e369720c2d035c27825e1ce4",class:"presto-player__muted-overlay",onClick:()=>{this.mutedPreview=!1,this.playVideo.emit()}},(null===(e=this.preset)||void 0===e?void 0:e["play-large"])&&h("div",{key:"231db6abba50bbe06312e3c6a162c651cb1408a8",class:"plyr__control plyr__control--overlaid","data-plyr":"play","aria-label":"Play",part:"muted-overlay-play"},h("svg",{key:"4bd21f713381abfafbcab0e26e7af9fefd3c10de",id:"plyr-play",viewBox:"0 0 18 18"},h("path",{key:"6ffa3046759503f5a46a7f6fcaef328494868811",d:"M15.562 8.1L3.87.225c-.818-.562-1.87 0-1.87.9v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"})),h("span",{key:"c00867bba01ae310176b7609bcb3cfb4218ef125",class:"plyr__sr-only"},"Play")),(null===(t=this.mutedOverlay)||void 0===t?void 0:t.enabled)&&(null===(l=this.mutedOverlay)||void 0===l?void 0:l.src)?h("div",{class:"presto-player__overlay is-image",part:"muted-overlay-image",style:{width:`${(null===(r=this.mutedOverlay)||void 0===r?void 0:r.width)||50}%`,left:100*((null===(o=null===(a=this.mutedOverlay)||void 0===a?void 0:a.focalPoint)||void 0===o?void 0:o.x)||.5)+"%",top:100*((null===(d=null===(s=this.mutedOverlay)||void 0===s?void 0:s.focalPoint)||void 0===d?void 0:d.y)||.5)+"%"}},h("img",{src:null===(i=this.mutedOverlay)||void 0===i?void 0:i.src,style:{transform:"translateX(-50%) translateY(-50%)"}})):"")}static get style(){return PrestoMutedOverlayStyle0}},[0,"presto-muted-overlay",{mutedPreview:[4,"muted-preview"],mutedOverlay:[16],preset:[16]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["presto-muted-overlay"].forEach((e=>{"presto-muted-overlay"===e&&(customElements.get(e)||customElements.define(e,PrestoMutedOverlay))}))}export{PrestoMutedOverlay as P,defineCustomElement as d};
/**
* Handles the activation of a Jetpack feature, dismissing the card, and replacing the bottom row
* of the card with customized content.
*/
/* global jetpackPluginSearch, jpTracksAJAX */
var JetpackPSH = {};
( function ( $, jpsh ) {
JetpackPSH = {
$pluginFilter: $( '#plugin-filter' ),
/**
* Get parent search hint element.
* @return {Element | null}
*/
getCard: function () {
return document.querySelector( '.plugin-card-jetpack-plugin-search' );
},
/**
* Track user event such as a click on a button or a link.
*
* @param {string} eventName Event identifier.
* @param {object} feature Identifier of feature involved in the event.
* @param {object} target Object where action was performed.
*/
trackEvent: function ( eventName, feature, target ) {
jpTracksAJAX
.record_ajax_event( eventName, 'click', { feature: feature } )
.always( function () {
if ( 'undefined' !== typeof target && !! target.getAttribute( 'href' ) ) {
// If it has an href, follow it.
window.location = target.getAttribute( 'href' );
}
} );
},
/**
* Update title of the card to add a mention that the result is from the Jetpack plugin.
*/
updateCardTitle: function () {
var hint = JetpackPSH.getCard();
if ( 'object' === typeof hint && null !== hint ) {
var title = hint.querySelector( '.column-name h3' );
title.outerHTML =
title.outerHTML + '' + jetpackPluginSearch.poweredBy + '';
}
},
/**
* Move action links below description.
*/
moveActionLinks: function () {
var hint = JetpackPSH.getCard();
if ( 'object' === typeof hint && null !== hint ) {
var descriptionContainer = hint.querySelector( '.column-description' );
// Keep only the first paragraph. The second is the plugin author.
var descriptionText = descriptionContainer.querySelector( 'p:first-child' );
var actionLinks = hint.querySelector( '.action-links' );
// Change the contents of the description, to keep the description text and the action links.
descriptionContainer.innerHTML = descriptionText.outerHTML + actionLinks.outerHTML;
// Remove the action links from their default location.
actionLinks.parentNode.removeChild( actionLinks );
}
},
/**
* Replace bottom row of the card to insert logo, text and link to dismiss the card.
*/
replaceCardBottom: function () {
var hint = JetpackPSH.getCard();
if ( 'object' === typeof hint && null !== hint ) {
hint.querySelector( '.plugin-card-bottom' ).outerHTML =
'';
// Remove link and parent li from action links and move it to bottom row
var dismissLink = document.querySelector( '.jetpack-plugin-search__dismiss' );
dismissLink.parentNode.parentNode.removeChild( dismissLink.parentNode );
document.querySelector( '.jetpack-plugin-search__bottom' ).appendChild( dismissLink );
}
},
/**
* Check if plugin card list nodes changed. If there's a Jetpack PSH card, replace the title and the bottom row.
* @param {array} mutationsList
*/
replaceOnNewResults: function ( mutationsList ) {
mutationsList.forEach( function ( mutation ) {
if (
'childList' === mutation.type &&
1 === document.querySelectorAll( '.plugin-card-jetpack-plugin-search' ).length
) {
JetpackPSH.updateCardTitle();
JetpackPSH.moveActionLinks();
JetpackPSH.replaceCardBottom();
}
} );
},
dismiss: function ( moduleName ) {
document.getElementById( 'the-list' ).removeChild( JetpackPSH.getCard() );
$.ajax( {
url: jpsh.base_rest_url + '/hints',
method: 'post',
beforeSend: function ( xhr ) {
xhr.setRequestHeader( 'X-WP-Nonce', jpsh.nonce );
},
data: JSON.stringify( {
hint: moduleName,
} ),
contentType: 'application/json',
dataType: 'json',
} ).done( function () {
JetpackPSH.trackEvent( 'wpa_plugin_search_dismiss', moduleName );
} );
},
ajaxActivateModule: function ( moduleName ) {
var $moduleBtn = JetpackPSH.$pluginFilter.find( '#plugin-select-activate' );
$moduleBtn.toggleClass( 'install-now updating-message' );
$moduleBtn.prop( 'disabled', true );
$moduleBtn.text( jpsh.activating );
var data = {};
data[ moduleName ] = true;
$.ajax( {
url: jpsh.base_rest_url + '/settings',
method: 'post',
beforeSend: function ( xhr ) {
xhr.setRequestHeader( 'X-WP-Nonce', jpsh.nonce );
},
data: JSON.stringify( data ),
contentType: 'application/json',
dataType: 'json',
} )
.done( function () {
JetpackPSH.updateButton( moduleName );
JetpackPSH.trackEvent( 'wpa_plugin_search_activate', moduleName );
} )
.error( function () {
$moduleBtn.toggleClass( 'install-now updating-message' );
} );
},
// Remove onclick handler, disable loading spinner, update button to redirect to module settings.
updateButton: function ( moduleName ) {
$.ajax( {
url: jpsh.base_rest_url + '/module/' + moduleName,
method: 'get',
beforeSend: function ( xhr ) {
xhr.setRequestHeader( 'X-WP-Nonce', jpsh.nonce );
},
dataType: 'json',
} ).done( function ( response ) {
var $moduleBtn = JetpackPSH.$pluginFilter.find( '#plugin-select-activate' );
$moduleBtn.prop( 'onclick', null ).off( 'click' );
$moduleBtn.toggleClass( 'install-now updating-message' );
$moduleBtn.text( jpsh.activated );
setTimeout( function () {
var url = 'https://jetpack.com/redirect/?source=plugin-hint-learn-' + moduleName,
label = jpsh.getStarted,
classes = 'jetpack-plugin-search__primary button',
track = 'configure';
// If the feature has options in Jetpack admin UI, link to them.
if ( response.options && 0 < Object.keys( response.options ).length ) {
url = $moduleBtn.data( 'configure-url' );
label = jpsh.manageSettings;
classes += ' jetpack-plugin-search__configure';
} else {
// If it has no options, the Get started button will be displayed so remove the Learn more link if it's there.
var learnMore = document.querySelector( '.jetpack-plugin-search__learn-more' );
learnMore.parentNode.removeChild( learnMore );
classes += ' jetpack-plugin-search__get-started';
track = 'get_started';
}
$moduleBtn.replaceWith(
'' +
label +
''
);
}, 1000 );
} );
},
/**
* Start suggesting.
*/
init: function () {
if ( JetpackPSH.$pluginFilter.length < 1 ) {
return;
}
// Update title to show that the suggestion is from Jetpack.
JetpackPSH.updateCardTitle();
// Update the description and action links.
JetpackPSH.moveActionLinks();
// Replace PSH bottom row on page load
JetpackPSH.replaceCardBottom();
// Listen for changes in plugin search results
var resultsObserver = new MutationObserver( JetpackPSH.replaceOnNewResults );
resultsObserver.observe( document.getElementById( 'plugin-filter' ), { childList: true } );
JetpackPSH.$pluginFilter
.on( 'click', '.jetpack-plugin-search__dismiss', function ( event ) {
event.preventDefault();
JetpackPSH.dismiss( $( this ).data( 'module' ) );
} )
.on( 'click', 'button#plugin-select-activate', function ( event ) {
event.preventDefault();
JetpackPSH.ajaxActivateModule( $( this ).data( 'module' ) );
} )
.on( 'click', '.jetpack-plugin-search__primary', function ( event ) {
event.preventDefault();
var $this = $( this );
if ( $this.data( 'track' ) ) {
// This catches Purchase, Configure, and Get started. Feature activation is tracked when it ends successfully, in its callback.
JetpackPSH.trackEvent(
'wpa_plugin_search_' + $this.data( 'track' ),
$this.data( 'module' ),
$this.get( 0 )
);
}
} )
.on( 'click', '.jetpack-plugin-search__learn-more', function ( event ) {
event.preventDefault();
var $this = $( this );
JetpackPSH.trackEvent(
'wpa_plugin_search_learn_more',
$this.data( 'module' ),
$this.get( 0 )
);
} )
.on( 'click', '.jetpack-plugin-search__support_link', function ( event ) {
event.preventDefault();
var $this = $( this );
JetpackPSH.trackEvent(
'wpa_plugin_search_support_link',
$this.data( 'module' ),
$this.get( 0 )
);
} );
},
};
JetpackPSH.init();
} )( jQuery, jetpackPluginSearch );