Make WordPress Core

Changeset 47610 for trunk


Ignore:
Timestamp:
04/22/2020 09:38:12 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Document the default value of $single and $prev_value parameters in various metadata functions.

Props denisco.
See #49572.

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

Legend:

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

    r47597 r47610  
    451451 * @param string $meta_key Metadata name.
    452452 * @param mixed $meta_value Metadata value.
    453  * @param bool $unique Optional, default is false. Whether the same key should not be added.
     453 * @param bool $unique Optional. Whether the same key should not be added. Default false.
    454454 * @return int|bool Meta ID on success, false on failure.
    455455 */
     
    485485 * @param int $comment_id Comment ID.
    486486 * @param string $key Optional. The meta key to retrieve. By default, returns data for all keys.
    487  * @param bool $single Whether to return a single value.
     487 * @param bool $single Optional. Whether to return a single value. Default false.
    488488 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
    489489 *  is true.
     
    507507 * @param string $meta_key Metadata key.
    508508 * @param mixed $meta_value Metadata value.
    509  * @param mixed $prev_value Optional. Previous value to check before removing.
     509 * @param mixed $prev_value Optional. Previous value to check before updating. Default empty.
    510510 * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
    511511 */
  • trunk/src/wp-includes/meta.php

    r47390 r47610  
    150150 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
    151151 * @param mixed  $prev_value Optional. If specified, only update existing metadata entries
    152  *                           with this value. Otherwise, update all entries.
     152 *                           with this value. Otherwise, update all entries. Default empty.
    153153 * @return int|bool The new meta field ID if a field with the given key didn't exist and was
    154154 *                  therefore added, true on successful update, false on failure.
  • trunk/src/wp-includes/ms-site.php

    r47198 r47610  
    10971097 * @param string $meta_key   Metadata key.
    10981098 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
    1099  * @param mixed  $prev_value Optional. Previous value to check before removing.
     1099 * @param mixed  $prev_value Optional. Previous value to check before updating.
    11001100 *                           Default empty.
    11011101 * @return int|bool Meta ID if the key didn't exist, true on successful update,
  • trunk/src/wp-includes/post.php

    r47582 r47610  
    21372137 * @param string $meta_key   Metadata key.
    21382138 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
    2139  * @param mixed  $prev_value Optional. Previous value to check before updating.
     2139 * @param mixed  $prev_value Optional. Previous value to check before updating. Default empty.
    21402140 * @return int|bool The new meta field ID if a field with the given key didn't exist and was
    21412141 *                  therefore added, true on successful update, false on failure.
  • trunk/src/wp-includes/taxonomy.php

    r47578 r47610  
    12471247 * @param int    $term_id Term ID.
    12481248 * @param string $key     Optional. The meta key to retrieve. If no key is provided, fetches all metadata for the term.
    1249  * @param bool   $single  Whether to return a single value. If false, an array of all values matching the
    1250  *                        `$term_id`/`$key` pair will be returned. Default: false.
     1249 * @param bool   $single  Optional. Whether to return a single value. If false, an array of all values matching the
     1250 *                        `$term_id`/`$key` pair will be returned. Default false.
    12511251 * @return mixed If `$single` is false, an array of metadata values. If `$single` is true, a single metadata value.
    12521252 */
     
    12671267 * @param string $meta_key   Metadata key.
    12681268 * @param mixed  $meta_value Metadata value.
    1269  * @param mixed  $prev_value Optional. Previous value to check before removing.
     1269 * @param mixed  $prev_value Optional. Previous value to check before updating. Default empty.
    12701270 * @return int|WP_Error|bool Meta ID if the key didn't previously exist. True on successful update.
    12711271 *                           WP_Error when term_id is ambiguous between taxonomies. False on failure.
  • trunk/src/wp-includes/user.php

    r47550 r47610  
    822822 * @param int    $user_id User ID.
    823823 * @param string $key     Optional. The meta key to retrieve. By default, returns data for all keys.
    824  * @param bool   $single  Whether to return a single value.
     824 * @param bool   $single  Optional. Whether to return a single value. Default false.
    825825 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single is true.
    826826 */
     
    843843 * @param string $meta_key   Metadata key.
    844844 * @param mixed  $meta_value Metadata value.
    845  * @param mixed  $prev_value Optional. Previous value to check before removing.
     845 * @param mixed  $prev_value Optional. Previous value to check before updating. Default empty.
    846846 * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
    847847 */
Note: See TracChangeset for help on using the changeset viewer.