Skip to content

Custom Metadata Manager 0.8.0

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Aug 22:59
· 4 commits to develop since this release
0.8.0
0dd9929

This release raises the minimum requirements to WordPress 6.4 and PHP 7.4.

It also changes some default behaviour that integrators should be aware of: plain-text fields no longer store raw HTML, the upload field is now readonly by default, and saving metadata now requires the current user to be able to edit the object. See the Security section for details.

Security

  • Escape stored metadata values when they are output in admin list-table columns, fixing a stored cross-site scripting (XSS) issue. Output rendered by a custom display_column_callback must be escaped by that callback.
  • Sanitize field values on save with a safe, field-type-aware default when a field has no sanitize_callback. Enabled by default; as a result, plain-text fields (such as text and textarea) no longer store raw HTML. Use a wysiwyg field for HTML, register a sanitize_callback, or filter custom_metadata_manager_apply_default_sanitize to opt out. See DEVELOPERS.md.
  • Require the current user to be able to edit the object (edit_post, edit_comment or edit_user) before saving its metadata, in addition to the existing nonce check.

Added

  • Added the ability to group several fields as a multifield; see x_add_metadata_multifield(), props @greatislander, @rinatkhaziev and @PhilippSchreiber for their contributions there.
  • Added the taxonomy_checkbox and taxonomy_multi_select field types, props @greatislander.
  • Added new field types: number, email, telephone, datetimepicker, timepicker and link (which uses the WP link manager).
  • Added the ability to add a default value for certain field types.
  • Added the ability to set a placeholder for certain fields.
  • Added the ability for groups to display a description.
  • Added the ability to limit capabilities for entire groups using required_cap.
  • Limit or exclude groups and fields using a custom callback.
  • Allow field types that save as multiples but do not display as cloneable or multiples.

Changed

  • Rewrote the upload field to use the media manager from WordPress 3.5+. Note the upload field is now readonly by default (but can be set to false when you set up the field).
  • Replaced chosen.js with select2.js.
  • Updated JavaScript to be up to standard with coding standards and be fully compatible with jQuery 1.9+.
  • Reformatted and cleaned up the CSS file.
  • Converted the plugin class to a singleton.
  • Made use of the selected() and checked() functions in WordPress instead of clumsy if statements.
  • Moved filtering of instance vars to init instead of on construct which runs too early.
  • Updated the examples file.
  • Adjusted the copyright to include 2013 and to list "The Contributors" instead of specific individuals.
  • Adjusted the list of contributors in the plugin.
  • Adjusted the plugin URL and removed the donate URL.
  • Adjusted files for code standards.

Fixed

  • Fixed PHP warning with empty values for date fields.