Make WordPress Core

Changeset 60264


Ignore:
Timestamp:
05/29/2025 11:07:35 PM (16 months ago)
Author:
johnbillion
Message:

Docs: Improvements and corrections to documentation relating to metadata.

See #63166

Location:
trunk/src/wp-includes
Files:
6 edited

Legend:

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

    r60235 r60264  
    447447 * Adds meta data field to a comment.
    448448 *
     449 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
     450 *
    449451 * @since 2.9.0
    450452 *
     
    474476 * value, will keep from removing duplicate metadata with the same key. It also
    475477 * allows removing all metadata matching key, if needed.
     478 *
     479 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
    476480 *
    477481 * @since 2.9.0
     
    540544 *
    541545 * If the meta field for the comment does not exist, it will be added.
     546 *
     547 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
    542548 *
    543549 * @since 2.9.0
  • trunk/src/wp-includes/meta.php

    r59862 r60264  
    1616 * Adds metadata for the specified object.
    1717 *
     18 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
     19 *
    1820 * @since 2.9.0
    1921 *
    2022 * @global wpdb $wpdb WordPress database abstraction object.
    2123 *
    22  * @param string $meta_type  Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    23  *                           or any other object type with an associated meta table.
     24 * @param string $meta_type  Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     25 *                           'user', or any other object type with an associated meta table.
    2426 * @param int    $object_id  ID of the object metadata is for.
    2527 * @param string $meta_key   Metadata key.
     
    6668         *
    6769         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    68          * (post, comment, term, user, or any other type with an associated meta table).
     70         * (blog, post, comment, term, user, or any other type with an associated meta table).
    6971         * Returning a non-null value will effectively short-circuit the function.
    7072         *
    7173         * Possible hook names include:
    7274         *
     75         *  - `add_blog_metadata`
    7376         *  - `add_post_metadata`
    7477         *  - `add_comment_metadata`
     
    7881         * @since 3.1.0
    7982         *
    80          * @param null|bool $check      Whether to allow adding metadata for the given type.
    81          * @param int       $object_id  ID of the object metadata is for.
    82          * @param string    $meta_key   Metadata key.
    83          * @param mixed     $meta_value Metadata value. Must be serializable if non-scalar.
    84          * @param bool      $unique     Whether the specified meta key should be unique for the object.
     83         * @param null|int|false $check      Whether to allow adding metadata for the given type. Return false or a meta ID
     84         *                                   to short-circuit the function. Return null to continue with the default behavior.
     85         * @param int            $object_id  ID of the object metadata is for.
     86         * @param string         $meta_key   Metadata key.
     87         * @param mixed          $meta_value Metadata value. Must be serializable if non-scalar.
     88         * @param bool           $unique     Whether the specified meta key should be unique for the object.
    8589         */
    8690        $check = apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique );
     
    106110         *
    107111         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    108          * (post, comment, term, user, or any other type with an associated meta table).
     112         * (blog, post, comment, term, user, or any other type with an associated meta table).
    109113         *
    110114         * Possible hook names include:
    111115         *
     116         *  - `add_blog_meta`
    112117         *  - `add_post_meta`
    113118         *  - `add_comment_meta`
     
    144149         *
    145150         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    146          * (post, comment, term, user, or any other type with an associated meta table).
     151         * (blog, post, comment, term, user, or any other type with an associated meta table).
    147152         *
    148153         * Possible hook names include:
    149154         *
     155         *  - `added_blog_meta`
    150156         *  - `added_post_meta`
    151157         *  - `added_comment_meta`
     
    169175 * ID and metadata key, the metadata will be added.
    170176 *
     177 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
     178 *
    171179 * @since 2.9.0
    172180 *
    173181 * @global wpdb $wpdb WordPress database abstraction object.
    174182 *
    175  * @param string $meta_type  Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    176  *                           or any other object type with an associated meta table.
     183 * @param string $meta_type  Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     184 *                           'user', or any other object type with an associated meta table.
    177185 * @param int    $object_id  ID of the object metadata is for.
    178186 * @param string $meta_key   Metadata key.
     
    219227         *
    220228         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    221          * (post, comment, term, user, or any other type with an associated meta table).
     229         * (blog, post, comment, term, user, or any other type with an associated meta table).
    222230         * Returning a non-null value will effectively short-circuit the function.
    223231         *
    224232         * Possible hook names include:
    225233         *
     234         *  - `update_blog_metadata`
    226235         *  - `update_post_metadata`
    227236         *  - `update_comment_metadata`
     
    278287                 *
    279288                 * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    280                  * (post, comment, term, user, or any other type with an associated meta table).
     289                 * (blog, post, comment, term, user, or any other type with an associated meta table).
    281290                 *
    282291                 * Possible hook names include:
    283292                 *
     293                 *  - `update_blog_meta`
    284294                 *  - `update_post_meta`
    285295                 *  - `update_comment_meta`
     
    324334                 *
    325335                 * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    326                  * (post, comment, term, user, or any other type with an associated meta table).
     336                 * (blog, post, comment, term, user, or any other type with an associated meta table).
    327337                 *
    328338                 * Possible hook names include:
    329339                 *
     340                 *  - `updated_blog_meta`
    330341                 *  - `updated_post_meta`
    331342                 *  - `updated_comment_meta`
     
    364375 * Deletes metadata for the specified object.
    365376 *
     377 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
     378 *
    366379 * @since 2.9.0
    367380 *
    368381 * @global wpdb $wpdb WordPress database abstraction object.
    369382 *
    370  * @param string $meta_type  Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    371  *                           or any other object type with an associated meta table.
     383 * @param string $meta_type  Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     384 *                           'user', or any other object type with an associated meta table.
    372385 * @param int    $object_id  ID of the object metadata is for.
    373386 * @param string $meta_key   Metadata key.
     
    412425         *
    413426         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    414          * (post, comment, term, user, or any other type with an associated meta table).
     427         * (blog, post, comment, term, user, or any other type with an associated meta table).
    415428         * Returning a non-null value will effectively short-circuit the function.
    416429         *
    417430         * Possible hook names include:
    418431         *
     432         *  - `delete_blog_metadata`
    419433         *  - `delete_post_metadata`
    420434         *  - `delete_comment_metadata`
     
    467481         *
    468482         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    469          * (post, comment, term, user, or any other type with an associated meta table).
     483         * (blog, post, comment, term, user, or any other type with an associated meta table).
    470484         *
    471485         * Possible hook names include:
    472486         *
     487         *  - `delete_blog_meta`
    473488         *  - `delete_post_meta`
    474489         *  - `delete_comment_meta`
     
    516531         *
    517532         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    518          * (post, comment, term, user, or any other type with an associated meta table).
     533         * (blog, post, comment, term, user, or any other type with an associated meta table).
    519534         *
    520535         * Possible hook names include:
    521536         *
     537         *  - `deleted_blog_meta`
    522538         *  - `deleted_post_meta`
    523539         *  - `deleted_comment_meta`
     
    564580 * @see get_metadata_default()
    565581 *
    566  * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    567  *                          or any other object type with an associated meta table.
     582 * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     583 *                          'user', or any other object type with an associated meta table.
    568584 * @param int    $object_id ID of the object metadata is for.
    569585 * @param string $meta_key  Optional. Metadata key. If not specified, retrieve all metadata for
     
    597613 * @since 5.5.0
    598614 *
    599  * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    600  *                          or any other object type with an associated meta table.
     615 * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     616 *                          'user', or any other object type with an associated meta table.
    601617 * @param int    $object_id ID of the object metadata is for.
    602618 * @param string $meta_key  Optional. Metadata key. If not specified, retrieve all metadata for
     
    624640         *
    625641         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    626          * (post, comment, term, user, or any other type with an associated meta table).
     642         * (blog, post, comment, term, user, or any other type with an associated meta table).
    627643         * Returning a non-null value will effectively short-circuit the function.
    628644         *
    629645         * Possible filter names include:
    630646         *
     647         *  - `get_blog_metadata`
    631648         *  - `get_post_metadata`
    632649         *  - `get_comment_metadata`
     
    642659         * @param string $meta_key  Metadata key.
    643660         * @param bool   $single    Whether to return only the first value of the specified `$meta_key`.
    644          * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    645          *                          or any other object type with an associated meta table.
     661         * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     662         *                          'user', or any other object type with an associated meta table.
    646663         */
    647664        $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single, $meta_type );
     
    688705 * @since 5.5.0
    689706 *
    690  * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    691  *                          or any other object type with an associated meta table.
     707 * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     708 *                          'user', or any other object type with an associated meta table.
    692709 * @param int    $object_id ID of the object metadata is for.
    693710 * @param string $meta_key  Metadata key.
     
    708725         *
    709726         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    710          * (post, comment, term, user, or any other type with an associated meta table).
     727         * (blog, post, comment, term, user, or any other type with an associated meta table).
    711728         *
    712729         * Possible filter names include:
    713730         *
     731         *  - `default_blog_metadata`
    714732         *  - `default_post_metadata`
    715733         *  - `default_comment_metadata`
     
    724742         * @param string $meta_key  Metadata key.
    725743         * @param bool   $single    Whether to return only the first value of the specified `$meta_key`.
    726          * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    727          *                          or any other object type with an associated meta table.
     744         * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     745         *                          'user', or any other object type with an associated meta table.
    728746         */
    729747        $value = apply_filters( "default_{$meta_type}_metadata", $value, $object_id, $meta_key, $single, $meta_type );
     
    741759 * @since 3.3.0
    742760 *
    743  * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    744  *                          or any other object type with an associated meta table.
     761 * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     762 *                          'user', or any other object type with an associated meta table.
    745763 * @param int    $object_id ID of the object metadata is for.
    746764 * @param string $meta_key  Metadata key.
     
    784802 * @global wpdb $wpdb WordPress database abstraction object.
    785803 *
    786  * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    787  *                          or any other object type with an associated meta table.
     804 * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     805 *                          'user', or any other object type with an associated meta table.
    788806 * @param int    $meta_id   ID for a specific meta row.
    789807 * @return stdClass|false {
     
    794812 *     @type string $meta_id    Optional. The meta ID when the meta type is any value except 'user'.
    795813 *     @type string $umeta_id   Optional. The meta ID when the meta type is 'user'.
     814 *     @type string $blog_id    Optional. The object ID when the meta type is 'blog'.
    796815 *     @type string $post_id    Optional. The object ID when the meta type is 'post'.
    797816 *     @type string $comment_id Optional. The object ID when the meta type is 'comment'.
     
    821840         *
    822841         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    823          * (post, comment, term, user, or any other type with an associated meta table).
     842         * (blog, post, comment, term, user, or any other type with an associated meta table).
    824843         * Returning a non-null value will effectively short-circuit the function.
    825844         *
    826845         * Possible hook names include:
    827846         *
     847         *  - `get_blog_metadata_by_mid`
    828848         *  - `get_post_metadata_by_mid`
    829849         *  - `get_comment_metadata_by_mid`
     
    863883 * @global wpdb $wpdb WordPress database abstraction object.
    864884 *
    865  * @param string       $meta_type  Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    866  *                                 or any other object type with an associated meta table.
     885 * @param string       $meta_type  Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     886 *                                 'user', or any other object type with an associated meta table.
    867887 * @param int          $meta_id    ID for a specific meta row.
    868888 * @param string       $meta_value Metadata value. Must be serializable if non-scalar.
     
    895915         *
    896916         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    897          * (post, comment, term, user, or any other type with an associated meta table).
     917         * (blog, post, comment, term, user, or any other type with an associated meta table).
    898918         * Returning a non-null value will effectively short-circuit the function.
    899919         *
    900920         * Possible hook names include:
    901921         *
     922         *  - `update_blog_metadata_by_mid`
    902923         *  - `update_post_metadata_by_mid`
    903924         *  - `update_comment_metadata_by_mid`
     
    9891010 * @global wpdb $wpdb WordPress database abstraction object.
    9901011 *
    991  * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    992  *                          or any other object type with an associated meta table.
     1012 * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1013 *                          'user', or any other object type with an associated meta table.
    9931014 * @param int    $meta_id   ID for a specific meta row.
    9941015 * @return bool True on successful delete, false on failure.
     
    10201041         *
    10211042         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    1022          * (post, comment, term, user, or any other type with an associated meta table).
     1043         * (blog, post, comment, term, user, or any other type with an associated meta table).
    10231044         * Returning a non-null value will effectively short-circuit the function.
    10241045         *
    10251046         * Possible hook names include:
    10261047         *
     1048         *  - `delete_blog_metadata_by_mid`
    10271049         *  - `delete_post_metadata_by_mid`
    10281050         *  - `delete_comment_metadata_by_mid`
     
    10601082                         *  - `delete_postmeta`
    10611083                         *  - `delete_commentmeta`
    1062                          *  - `delete_termmeta`
    1063                          *  - `delete_usermeta`
    10641084                         *
    10651085                         * @since 3.4.0
     
    10911111                         *  - `deleted_postmeta`
    10921112                         *  - `deleted_commentmeta`
    1093                          *  - `deleted_termmeta`
    1094                          *  - `deleted_usermeta`
    10951113                         *
    10961114                         * @since 3.4.0
     
    11161134 * @global wpdb $wpdb WordPress database abstraction object.
    11171135 *
    1118  * @param string       $meta_type  Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1119  *                                 or any other object type with an associated meta table.
     1136 * @param string       $meta_type  Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1137 *                                 'user', or any other object type with an associated meta table.
    11201138 * @param string|int[] $object_ids Array or comma delimited list of object IDs to update cache for.
    11211139 * @return array|false Metadata cache for the specified objects, or false on failure.
     
    11461164         *
    11471165         * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type
    1148          * (post, comment, term, user, or any other type with an associated meta table).
     1166         * (blog, post, comment, term, user, or any other type with an associated meta table).
    11491167         * Returning a non-null value will effectively short-circuit the function.
    11501168         *
    11511169         * Possible hook names include:
    11521170         *
     1171         *  - `update_blog_metadata_cache`
    11531172         *  - `update_post_metadata_cache`
    11541173         *  - `update_comment_metadata_cache`
     
    12691288 * @global wpdb $wpdb WordPress database abstraction object.
    12701289 *
    1271  * @param string $type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1272  *                     or any other object type with an associated meta table.
     1290 * @param string $type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1291 *                     'user', or any other object type with an associated meta table.
    12731292 * @return string|false Metadata table name, or false if no metadata table exists
    12741293 */
     
    12911310 *
    12921311 * @param string $meta_key  Metadata key.
    1293  * @param string $meta_type Optional. Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1294  *                          or any other object type with an associated meta table. Default empty string.
     1312 * @param string $meta_type Optional. Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1313 *                          'user', or any other object type with an associated meta table. Default empty string.
    12951314 * @return bool Whether the meta key is considered protected.
    12961315 */
     
    13061325         * @param bool   $protected Whether the key is considered protected.
    13071326         * @param string $meta_key  Metadata key.
    1308          * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1309          *                          or any other object type with an associated meta table.
     1327         * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1328         *                          'user', or any other object type with an associated meta table.
    13101329         */
    13111330        return apply_filters( 'is_protected_meta', $protected, $meta_key, $meta_type );
     
    13201339 * @param string $meta_key       Metadata key.
    13211340 * @param mixed  $meta_value     Metadata value to sanitize.
    1322  * @param string $object_type    Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1323  *                               or any other object type with an associated meta table.
     1341 * @param string $object_type    Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1342 *                               'user', or any other object type with an associated meta table.
    13241343 * @param string $object_subtype Optional. The subtype of the object type. Default empty string.
    13251344 * @return mixed Sanitized $meta_value.
     
    13321351                 *
    13331352                 * The dynamic portions of the hook name, `$object_type`, `$meta_key`,
    1334                  * and `$object_subtype`, refer to the metadata object type (comment, post, term, or user),
     1353                 * and `$object_subtype`, refer to the metadata object type (blog, comment, post, term, or user),
    13351354                 * the meta key value, and the object subtype respectively.
    13361355                 *
     
    13391358                 * @param mixed  $meta_value     Metadata value to sanitize.
    13401359                 * @param string $meta_key       Metadata key.
    1341                  * @param string $object_type    Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1342                  *                               or any other object type with an associated meta table.
     1360                 * @param string $object_type    Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1361                 *                               'user', or any other object type with an associated meta table.
    13431362                 * @param string $object_subtype Object subtype.
    13441363                 */
     
    13501369         *
    13511370         * The dynamic portions of the hook name, `$meta_type`, and `$meta_key`,
    1352          * refer to the metadata object type (comment, post, term, or user) and the meta
     1371         * refer to the metadata object type (blog, comment, post, term, or user) and the meta
    13531372         * key value, respectively.
    13541373         *
     
    13571376         * @param mixed  $meta_value  Metadata value to sanitize.
    13581377         * @param string $meta_key    Metadata key.
    1359          * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1360          *                            or any other object type with an associated meta table.
     1378         * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1379         *                            'user', or any other object type with an associated meta table.
    13611380         */
    13621381        return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}", $meta_value, $meta_key, $object_type );
     
    13701389 * overridden in case a more specific meta key of the same name exists for the same object type and a subtype.
    13711390 *
    1372  * If an object type does not support any subtypes, such as users or comments, you should commonly call this function
     1391 * If an object type does not support any subtypes, such as blogs, users, or comments, you should commonly call this function
    13731392 * without passing a subtype.
    13741393 *
     
    13831402 * @since 6.7.0 The `label` argument was added to the arguments array.
    13841403 *
    1385  * @param string       $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1386  *                                  or any other object type with an associated meta table.
     1404 * @param string       $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1405 *                                  'user', or any other object type with an associated meta table.
    13871406 * @param string       $meta_key    Meta key to register.
    13881407 * @param array        $args {
     
    14621481         * @param array  $args        Array of meta registration arguments.
    14631482         * @param array  $defaults    Array of default arguments.
    1464          * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1465          *                            or any other object type with an associated meta table.
     1483         * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1484         *                            'user', or any other object type with an associated meta table.
    14661485         * @param string $meta_key    Meta key.
    14671486         */
     
    15581577 * @param bool   $single    If true, return only the first value of the specified `$meta_key`.
    15591578 *                          This parameter has no effect if `$meta_key` is not specified.
    1560  * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1561  *                          or any other object type with an associated meta table.
     1579 * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1580 *                          'user', or any other object type with an associated meta table.
    15621581 * @return mixed An array of default values if `$single` is false.
    15631582 *               The default value of the meta field if `$single` is true.
     
    16131632 * @since 4.9.8 The `$object_subtype` parameter was added.
    16141633 *
    1615  * @param string $object_type    Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1616  *                               or any other object type with an associated meta table.
     1634 * @param string $object_type    Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1635 *                               'user', or any other object type with an associated meta table.
    16171636 * @param string $meta_key       Metadata key.
    16181637 * @param string $object_subtype Optional. The subtype of the object type. Default empty string.
     
    16321651 * @since 4.9.8 The `$object_subtype` parameter was added.
    16331652 *
    1634  * @param string $object_type    Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1635  *                               or any other object type with an associated meta table.
     1653 * @param string $object_type    Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1654 *                               'user', or any other object type with an associated meta table.
    16361655 * @param string $meta_key       Metadata key.
    16371656 * @param string $object_subtype Optional. The subtype of the object type. Default empty string.
     
    16821701 * @since 4.9.8 The `$object_subtype` parameter was added.
    16831702 *
    1684  * @param string $object_type    Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1685  *                               or any other object type with an associated meta table.
     1703 * @param string $object_type    Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1704 *                               'user', or any other object type with an associated meta table.
    16861705 * @param string $object_subtype Optional. The subtype of the object type. Default empty string.
    16871706 * @return array[] List of registered metadata args, keyed by their meta keys.
     
    17051724 * @since 4.6.0
    17061725 *
    1707  * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1708  *                            or any other object type with an associated meta table.
     1726 * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1727 *                            'user', or any other object type with an associated meta table.
    17091728 * @param int    $object_id   ID of the object the metadata is for.
    17101729 * @param string $meta_key    Optional. Registered metadata key. If not specified, retrieve all registered
     
    17681787 * @since 4.9.8
    17691788 *
    1770  * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    1771  *                            or any other object type with an associated meta table.
     1789 * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term',
     1790 *                            'user', or any other object type with an associated meta table.
    17721791 * @param int    $object_id   ID of the object to retrieve its subtype.
    17731792 * @return string The object subtype or an empty string if unspecified subtype.
     
    18151834
    18161835        /**
    1817          * Filters the object subtype identifier for a non-standard object type.
     1836         * Filters the object subtype identifier.
    18181837         *
    18191838         * The dynamic portion of the hook name, `$object_type`, refers to the meta object type
    1820          * (post, comment, term, user, or any other type with an associated meta table).
     1839         * (blog, post, comment, term, user, or any other type with an associated meta table).
    18211840         *
    18221841         * Possible hook names include:
    18231842         *
     1843         *  - `get_object_subtype_blog`
    18241844         *  - `get_object_subtype_post`
    18251845         *  - `get_object_subtype_comment`
     
    18291849         * @since 4.9.8
    18301850         *
    1831          * @param string $object_subtype Empty string to override.
     1851         * @param string $object_subtype Object subtype or empty string to override.
    18321852         * @param int    $object_id      ID of the object to get the subtype for.
    18331853         */
  • trunk/src/wp-includes/ms-site.php

    r59657 r60264  
    10231023 * Adds metadata to a site.
    10241024 *
     1025 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
     1026 *
    10251027 * @since 5.1.0
    10261028 *
     
    10481050 * value, will keep from removing duplicate metadata with the same key. It also
    10491051 * allows removing all metadata matching key, if needed.
     1052 *
     1053 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
    10501054 *
    10511055 * @since 5.1.0
     
    10911095 * Updates metadata for a site.
    10921096 *
    1093  * Use the $prev_value parameter to differentiate between meta fields with the
     1097 * Use the `$prev_value` parameter to differentiate between meta fields with the
    10941098 * same key and site ID.
    10951099 *
    10961100 * If the meta field for the site does not exist, it will be added.
     1101 *
     1102 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
    10971103 *
    10981104 * @since 5.1.0
  • trunk/src/wp-includes/post.php

    r60236 r60264  
    26092609 * Post meta data is called "Custom Fields" on the Administration Screen.
    26102610 *
     2611 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
     2612 *
    26112613 * @since 1.5.0
    26122614 *
     
    26402642 * value, will keep from removing duplicate metadata with the same key. It also
    26412643 * allows removing all metadata matching the key, if needed.
     2644 *
     2645 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
    26422646 *
    26432647 * @since 1.5.0
     
    26952699 *
    26962700 * Can be used in place of add_post_meta().
     2701 *
     2702 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
    26972703 *
    26982704 * @since 1.5.0
  • trunk/src/wp-includes/taxonomy.php

    r60249 r60264  
    13831383 * Adds metadata to a term.
    13841384 *
     1385 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
     1386 *
    13851387 * @since 4.4.0
    13861388 *
     
    14091411/**
    14101412 * Removes metadata matching criteria from a term.
     1413 *
     1414 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
    14111415 *
    14121416 * @since 4.4.0
     
    14561460 * If the meta field for the term does not exist, it will be added.
    14571461 *
     1462 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
     1463 *
    14581464 * @since 4.4.0
    14591465 *
  • trunk/src/wp-includes/user.php

    r60240 r60264  
    12031203 * Adds meta data to a user.
    12041204 *
     1205 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
     1206 *
    12051207 * @since 3.0.0
    12061208 *
     
    12281230 * value, will keep from removing duplicate metadata with the same key. It also
    12291231 * allows removing all metadata matching key, if needed.
     1232 *
     1233 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
    12301234 *
    12311235 * @since 3.0.0
     
    12791283 *
    12801284 * If the meta field for the user does not exist, it will be added.
     1285 *
     1286 * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input.
    12811287 *
    12821288 * @since 3.0.0
Note: See TracChangeset for help on using the changeset viewer.