Make WordPress Core

Changeset 52140


Ignore:
Timestamp:
11/11/2021 06:30:27 PM (3 years ago)
Author:
davidbaumwald
Message:

Options, Meta APIs: Correct docs for $_meta_value parameter in xxx_{$meta_type}_meta hooks.

In add_{$meta_type}_meta, added_{$meta_type}_meta, update_{$meta_type}_meta, updated_{$meta_type}_meta, delete_{$meta_type}_meta, and deleted_{$meta_type}_meta hooks, the $_meta_value parameter was documented as "Serialized if non-scalar". However, $_meta_value is a copy of the raw meta value before maybe_serialize is run and is not serialized. This change updates each of the above hooks' docblocks to remove "Serialized if non-scalar" from the $_meta_value parameter description.

Props pputzer, hasanuzzamanshamim.
Fixes #53102.

File:
1 edited

Legend:

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

    r51837 r52140  
    111111     * @param int    $object_id   ID of the object metadata is for.
    112112     * @param string $meta_key    Metadata key.
    113      * @param mixed  $_meta_value Metadata value. Serialized if non-scalar.
     113     * @param mixed  $_meta_value Metadata value.
    114114     */
    115115    do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value );
     
    150150     * @param int    $object_id   ID of the object metadata is for.
    151151     * @param string $meta_key    Metadata key.
    152      * @param mixed  $_meta_value Metadata value. Serialized if non-scalar.
     152     * @param mixed  $_meta_value Metadata value.
    153153     */
    154154    do_action( "added_{$meta_type}_meta", $mid, $object_id, $meta_key, $_meta_value );
     
    284284         * @param int    $object_id   ID of the object metadata is for.
    285285         * @param string $meta_key    Metadata key.
    286          * @param mixed  $_meta_value Metadata value. Serialized if non-scalar.
     286         * @param mixed  $_meta_value Metadata value.
    287287         */
    288288        do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
     
    330330         * @param int    $object_id   ID of the object metadata is for.
    331331         * @param string $meta_key    Metadata key.
    332          * @param mixed  $_meta_value Metadata value. Serialized if non-scalar.
     332         * @param mixed  $_meta_value Metadata value.
    333333         */
    334334        do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
     
    472472     * @param int      $object_id   ID of the object metadata is for.
    473473     * @param string   $meta_key    Metadata key.
    474      * @param mixed    $_meta_value Metadata value. Serialized if non-scalar.
     474     * @param mixed    $_meta_value Metadata value.
    475475     */
    476476    do_action( "delete_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
     
    522522     * @param int      $object_id   ID of the object metadata is for.
    523523     * @param string   $meta_key    Metadata key.
    524      * @param mixed    $_meta_value Metadata value. Serialized if non-scalar.
     524     * @param mixed    $_meta_value Metadata value.
    525525     */
    526526    do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
Note: See TracChangeset for help on using the changeset viewer.