Make WordPress Core


Ignore:
Timestamp:
09/16/2024 11:31:17 AM (10 months ago)
Author:
gziolo
Message:

Meta: Add label argument to register_meta function

With the introduction of Block Bindings, it became more common to see workflows where users need to see the custom fields that are available or connected. They were relying on the meta key, however it feelt too technical sometimes. The solution is adding a new label argument to include a human-readable name that can be used across the UI.

Props santosguillamot, mamaduka, gziolo, timothyblynjacobs, peterwilsoncc.
Fixes #61998.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/meta.php

    r58962 r59023  
    13701370 * @since 5.5.0 The `$default` argument was added to the arguments array.
    13711371 * @since 6.4.0 The `$revisions_enabled` argument was added to the arguments array.
     1372 * @since 6.7.0 The `label` argument was added to the arguments array.
    13721373 *
    13731374 * @param string       $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
     
    13811382 *     @type string     $type              The type of data associated with this meta key.
    13821383 *                                         Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'.
     1384 *     @type string     $label             A human-readable label of the data attached to this meta key.
    13831385 *     @type string     $description       A description of the data attached to this meta key.
    13841386 *     @type bool       $single            Whether the meta key has one value per object, or an array of values per object.
     
    14131415        'object_subtype'    => '',
    14141416        'type'              => 'string',
     1417        'label'             => '',
    14151418        'description'       => '',
    14161419        'default'           => '',
Note: See TracChangeset for help on using the changeset viewer.