Skip to content

Releases: CMB2/CMB2

v2.12.0

Choose a tag to compare

@jtsternberg jtsternberg released this 31 May 02:35

Enhancements

  • Confirmed compatibility with PHP 8.2 and 8.3, and tested up to WordPress 7.0.
  • [Development] Migrated end-to-end testing from Cypress to Playwright and replaced Grunt with npm scripts for the asset build pipeline. (#1550).
  • [Development] Moved the local development and test environment to @wordpress/env (wp-env) on pinned ports, running both PHPUnit and Playwright through it. (#1554, #1558).
  • [Development] Replaced Travis CI with GitHub Actions, added a PHPCompatibility check (PHP 7.4+) and a PHPCS/WPCS lint gate, and overhauled install-wp-tests.sh for modern WordPress. (#1555).

Bug Fixes

  • Fixed a PHP 8.1+ deprecation when sanitizing an empty textarea-based field (passing null to wp_kses_post()). Props @baljindersingh88 (#1537).
  • Fixed row iterator value desync between the data attribute and jQuery data when reordering repeatable group rows. Props @angryaxi (#1518).
  • Fixed a PHP 8.3 ltrim() deprecation in the taxonomy field display.
  • Hardened against PHP 8.2+ dynamic property deprecations by widening #[AllowDynamicProperties] to the class roots.
  • Removed a focus-background rule on .cmb2-wrap inputs that caused unexpected input styling. Fixes #1556/wordpress.org/support/topic/weird-checkbox-behaviour-on-wp-7 (#1557).

v2.11.0

Choose a tag to compare

@jtsternberg jtsternberg released this 16 Apr 01:45
  • Officially moved to PHP 7.4+ support!

Enhancements

  • Package updates.
  • Update WordPress Tested up to tag 6.1. Props @RubenMartins (#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 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)
  • [Development] Some build script improvements.
  • [Development] Added some PHPCS/WPCS config.
  • [Development] Added a phpcompatibility action. Props @jazzsequence (#1499, #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)
  • Fixes issue where Select/Deselect all does not trigger change JS DOM events. Fixes #1504.

v2.10.1

Choose a tag to compare

@jtsternberg jtsternberg released this 22 Feb 14:18

Bug Fixes

  • Fix issue with date picker formatting. Fixes #1448.

v2.10.0

Choose a tag to compare

@jtsternberg jtsternberg released this 15 Feb 17:17

Enhancements

  • Sanitize URLs, defaulting to https. Props @paulschreiber (#1413).
  • Establish Cypress E2E Testing. Props @markjaquith (#1437).
  • Updated the JS shiftRows functionality to be simpler, and fix issues with JS initialization. Fixes #1426 and #1431.
  • Updated various NPM dependencies for security issues.

Bug Fixes

  • Update to prevent deprecation notice:Required parameter $i follows optional parameter $args.... Props @carloswph (#1417).
  • Make each date field more resilient to various date/timestamp values passed in (from REST API).

v2.9.0

Choose a tag to compare

@jtsternberg jtsternberg released this 04 Mar 02:45

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.
  • Limit use of italic, including removing from field descriptions. Fixes #1404.
  • Add to list of valid image types from get_allowed_mime_types(), which makes SVGs more reliable when using the Safe SVG plugin. Fixes #1223.

Bug Fixes

  • Fixes PHP warnings on repeatable ColorPicker with an array as default. Props @rubengc (#1340).
  • Address PHP 7.4, compatibility issues with func_get_args(). Fixes #1389.
  • Better generated array key for cached fields, fixes issue where wrong field is found. Fixes #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.

v2.8.0

Choose a tag to compare

@jtsternberg jtsternberg released this 08 Feb 16:17

Enhancements

Bug Fixes

  • Ensure enqueue wp-color-picker is enqueued for color fields. Props @rubengc (#1339).
  • Fix empty name/id attributes on 'file_list' buttons. Props @pgroot91 (#1347).
  • Fix wysiwyg field type not working in a group, by ensuring scripts properly enqueued. Props @yoren (#1361).
  • Fix $object_id doc block types in helper-functions.php. Fixes #1365.
  • Fix Metabox toggles visually broken with WP 5.5.x. Fixes #1382.
  • Fix PHP Deprecated: Required parameter $field_id follows optional parameter $type, due to changes in PHP 8.0. Fixes #1396.
  • Fix PHP notice caused by deprecated_param method in PHP 7.4. Props @jonathanstegall (#1400).

v2.7.0

Choose a tag to compare

@jtsternberg jtsternberg released this 21 Jan 19:11

Enhancements

  • Added support for sortable columns by default, with ability to disable with 'column' => array( 'disable_sortable' => true ). Props @RubenMartins (#1281).
  • New field type, 'taxonomy_select_hierarchical'. Fixes #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 (#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 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 (#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 for more context.
  • Cleanup by renaming CMB2_hookup to CMB2_Hookup. Classes are case-insensitive, so this is a backwards-compatible change. Props @szepeviktor (#1330, #1328).
  • Validate composer.json for Travis CI. Props @szepeviktor (#1326).
  • Added LICENSE file to meet GitHub Community standards. Props @RubenMartins (#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. Props @kevinlangleyjr, @mikeselander (#1255, #1257, #1259, #1261 #1262, and various direct commits. See #1260).

Bug Fixes

  • Fix some issues with Travis. Props @anhskohbo (#1220).
  • Javascript: Correctly pass the newly created row to the cmb2_add_row triggered event.
  • Various code-formatting and code documentation improvements. Props @tw2113.
  • Don't exclude composer.json from the distribution. Props @johnbillion (#1225).
  • Ignore some more directories in the distribution package. Props @johnbillion (#1226).
  • Use CMB2_Field::get_rest_value() to get values for fields in the post REST API endpoints (#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.
  • 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/.
  • Escaping Improvements to File Base and File Fields. Props @tomjn (#1296, #1297).
  • Fix issue where repeatable CodeMirror textareas could not be clicked/draggged to highlight text. Props @JPry (#1300).
  • taxonomy_select_hierarchical now saves to the correct location, the term relationships table. Props @latheva (#1307).
  • Fix issue (#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 (#1238).
  • Update and cull npm dependencis. Fixes #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.
  • Added function_exists( 'add_action' ) check to bootstrap file to ensure compatibility with composer usage. Props @salcode (#1271, #1270)
  • Corrected link to facetwp-cmb2 in README.md. Props @marcelreschke (#1248).
  • Use get_user_locale() in admin area instead of get_locale(). Fixes #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.

v2.6.0

Choose a tag to compare

@jtsternberg jtsternberg released this 21 Jan 04:33

Enhancements

  • Updated PHPUnit version in composer.json. Props @slaFFik (#1204).
  • Package.json: fix the need of global (old) grunt. Props @slaFFik (#1206).
  • Add optional confirmation dialog to group field's Remove button. Example documented in the example functions file. Props @slaFFik (#1208).
  • Add 'id' attribute on group field .postbox divs to ensure compatibility with scripts which expect ids there. Props @amans2k (#1108).
  • Make CMB2_Option properties accessible. (#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 (#953).
  • Introduce three new filters to filter field arguments: 'cmb2_field_defaults', 'cmb2_field_arguments_raw', 'cmb2_field_arguments'. Props @jrfnl (#588).

Bug Fixes

  • Remove superfluous method definitions. Props @tnorthcutt (#1200).
  • Fix rest_value_cb registering of filter. Props @lipemat (#1212).
  • Do not trigger tinyMCE editor save for the activeEditor. Prevents cursor jump in Gutenberg. Fixes #1202
  • Fix issue where making a field repeatable would generate a Javascript error because of missing sortable library. Props @slaFFik (#1216).
  • Ensure value passed to CMB2_Utils::filter_empty from CMB2::save_group_field is always an array. (#1026)
  • Fix potential issue with test path location. Props @quasel (#463).

v2.5.1

Choose a tag to compare

@jtsternberg jtsternberg released this 10 Dec 15:13

Bug Fixes

  • Fix issue when the core/editor object does not exist (is undefined), causing incompatibility issues with Yoast and likely others. Fixes #1197

v2.5.0

Choose a tag to compare

@jtsternberg jtsternberg released this 08 Dec 23:28

Enhancements

  • Repeatable fields are now drag-sortable. Props @lipemat (#1142).
  • Update the sv_SE translation. Props @edvind (#370).
  • QA/PHPCS cleanup. Props @tw2113 (#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. Fixes #1191
  • Support any type of markup when customizing repeating group row. Props @lipemat (#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. Fixes #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 (#1166).
  • Fix occasonal fatal errors that can occur by using callback functions directly vs call_user_func. Props @manzoorwanijk (#1177).
  • Fix issue where wysiwyg fields' visual tab wouldn't save content on Gutenberg/block-editor posts. Props @staurand (#1190 fixes #1156).
  • Fix issue when remove_default wouldn't actually remove the default taxonomy metabox when box registration used an alternate box context. Props @lipemat (#1147).