diff --git a/wp-includes/meta.php b/wp-includes/meta.php index 32838b135d..6f6dd928e0 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -1369,6 +1369,7 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * @since 5.3.0 Valid meta types expanded to include "array" and "object". * @since 5.5.0 The `$default` argument was added to the arguments array. * @since 6.4.0 The `$revisions_enabled` argument was added to the arguments array. + * @since 6.7.0 The `label` argument was added to the arguments array. * * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', * or any other object type with an associated meta table. @@ -1380,6 +1381,7 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * the meta key will be registered on the entire object type. Default empty. * @type string $type The type of data associated with this meta key. * Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'. + * @type string $label A human-readable label of the data attached to this meta key. * @type string $description A description of the data attached to this meta key. * @type bool $single Whether the meta key has one value per object, or an array of values per object. * @type mixed $default The default value returned from get_metadata() if no value has been set yet. @@ -1412,6 +1414,7 @@ function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { $defaults = array( 'object_subtype' => '', 'type' => 'string', + 'label' => '', 'description' => '', 'default' => '', 'single' => false, diff --git a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php index 5f3b55843e..aa0bc644bc 100644 --- a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php +++ b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php @@ -478,6 +478,7 @@ abstract class WP_REST_Meta_Fields { $default_schema = array( 'type' => $default_args['type'], + 'title' => empty( $args['label'] ) ? '' : $args['label'], 'description' => empty( $args['description'] ) ? '' : $args['description'], 'default' => isset( $args['default'] ) ? $args['default'] : null, ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 5e86294e34..7a90d61357 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-59022'; +$wp_version = '6.7-alpha-59023'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.