Repository navigation
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_callbackmust 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 astextandtextarea) no longer store raw HTML. Use awysiwygfield for HTML, register asanitize_callback, or filtercustom_metadata_manager_apply_default_sanitizeto opt out. See DEVELOPERS.md. - Require the current user to be able to edit the object (
edit_post,edit_commentoredit_user) before saving its metadata, in addition to the existing nonce check.
Added
- Added the ability to group several fields as a
multifield; seex_add_metadata_multifield(), props @greatislander, @rinatkhaziev and @PhilippSchreiber for their contributions there. - Added the
taxonomy_checkboxandtaxonomy_multi_selectfield types, props @greatislander. - Added new field types:
number,email,telephone,datetimepicker,timepickerandlink(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
uploadfield to use the media manager from WordPress 3.5+. Note theuploadfield is nowreadonlyby default (but can be set tofalsewhen 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()andchecked()functions in WordPress instead of clumsy if statements. - Moved filtering of instance vars to
initinstead of onconstructwhich 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.