Releases: CMB2/CMB2
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 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, #627. -
Complete the
zh-CN
translation. Props @uicestone (#1089). -
Update the
nl_NL
translation. Props @tammohaannl (#1101). -
Better display for white over transparent images (e.g. logos) by using a checkered background for images. (#1103)
-
Ability to disable the options autoload parameter via filter (
"cmb2_should_autoload_{$options_key}"
) or via a box parameter for'options-page'
box registrations ('autoload' => false,
). (#1093) -
'textarea_code'
field type now uses CodeMirror that is used by WordPress (#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 adata-codeeditor
attribute. E.g:'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 ofCMB2
,CMB2_Boxes::get_by( $property, $optional_compare )
andCMB2_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.
- Repeated fields now use registered field defaults for values. Fixes #1137.
- Fixed the formatting for deprecated messages in the log.
- Prevent opening of media modal when clicking the file "Download" link. Fixes #1130.
v2.3.0
Enhancements
- Updated Italian translation. Props @Mte90 (#1067).
- Starting with this release, we are fully switching to the more communicative and standard Semantic Versioning. (#1061).
Bug Fixes
v2.2.6.2
- Fix another issue (introduced in 2.2.6) with repeatable fields not being able to save additional fields. Props @anhskohbo (#1059, #1058).
- Only dequeue
jw-cmb2-rgba-picker-js
script (and enqueue ourwp-color-picker-alpha
) if it is actually found.
v2.2.6.1
Enhancements
- Merge in the CMB2 RGBa Colorpicker 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. Thank you to 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.
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. - 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 (#1046).
- Added a
'message_cb'
box property, which allows defining a custom callback for adding options-save messages onoptions-page
boxes. An example has been added to example-functions.php. - 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. 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). - 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. - Fix issue where some European date formats (e.g.
F j, Y
) would not properly translate into jQuery UI date formats. Support thread - Fix repeating fields within repeating groups having the values/indexes incorrectly associated. Props @daggerhart (#1047). Fixes #1035, #348.
- Fixed multiple update messages on settings pages when CMB2 option pages were registered (#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).
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 (#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. See #1013. - Fix issues with apostrophes in money values. (e.g. in Swiss German the thousand separator is an apostrophe). Props @ocean90 (#1014, #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.
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
- Fix issue in 2.2.5 with options pages not saving when parent_slug was used. Fixes #1008.
v2.2.5.1
v2.2.5
Updates
See 2.2.5.1 and 2.2.5.2 for bug-fix releases.
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. (The snippets in the snippet library will be updated to reflect this change)
- Improved Options Page styling. Props @anhskohbo (#1006).
- Improved cohesive styles for repeatable fields. Props @anhskohbo (#819).
- New field types,
'taxonomy_radio_hierarchical'
, and'taxonomy_multicheck_hierarchical'
, for displaying taxonomy options in a hierarchial layout. Props to eriktelepovsky for the working code. (#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.
- Enable the additional media library modal filters. Fixes #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 toget_terms()
. - The
cmb2_can_save
filter now passes the CMB2 object as the 2nd parameter. Props @Arno33 (#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
- Include absolute paths when including the core php files. Props @anhskohbo (#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. - 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. - 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).
- Fix regression with custom fields not properly repeating. Props @desrosj (#969). Fixes #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 theCMB2_Option
class. Props @anhskohbo (#993). - Fix bug where select fields or checkbox fields occasionally would retain previous group's value when adding new groups. Fixes #853.
- Fix JS to prevent meta keys with
|
or/
from breaking file fields. Props @lipemat (#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.
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. -
Allow outputting CMB2 boxes/fields in additional locations in the post-editor.
The new locations are:
form_top
,before_permalink
,after_title
, andafter_editor
These would be defined by setting the
context
property for your box:$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,
. -
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 theCMB2_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. -
New
CMB2_Utils
methods,get_available_image_sizes()
andget_named_size()
. Props @Cai333.
Bug Fixes
- Fix datepicker month/year dropdown text color. On windows, the option text was showing as white (invisible). Fixes #770.
- Repeatable WYSIWYG no longer breaks if
'quicktags'
param is set to false. Props @timburden (#797, #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 (#763, #700).
- Fix issue where term meta would not be applied when using the new term form if multiple object types were specified. Props @ADC07 (#842, #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). - Fix issue where empty file field in group would still cause non-empty values to store to database. (#721).
- Make
file
/file_list
field preview images work with named sizes. Props @Cai333 (#848, #844). - Fix incorrect text-domain. (#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).