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_attributesfilter. - 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_savefilter 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_listfields to properly show a preview for SVG images. Fixes #874. - Fix and standardize inconsistent button classes. Update all buttons to use the
.button-secondaryclass instead of the.buttonclass. This alleviates some front-end issues for themes which target the.buttonclass. This is a backwards-compatibility break. If your theme or plugin targets the.buttonclass 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_Optionmethods are called when the option value is empty, as well as additional unit tests for theCMB2_Optionclass. 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 propertieswarning. - Fix issue with CMB2 being too aggressive with stripping slashes from values. Fixes #981.