Make WordPress Core


Ignore:
Timestamp:
06/29/2020 09:20:11 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for the $prev_value parameter and return result of various metadata update functions.

Props stevenlinx.
Fixes #50502. See #49572.

File:
1 edited

Legend:

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

    r48212 r48214  
    21412141 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
    21422142 * @param mixed  $prev_value Optional. Previous value to check before updating.
    2143  *                           Default empty.
     2143 *                           If specified, only update existing metadata entries with
     2144 *                           this value. Otherwise, update all entries. Default empty.
    21442145 * @return int|bool Meta ID if the key didn't exist, true on successful update,
    2145  *                  false on failure.
     2146 *                  false on failure or if the value passed to the function
     2147 *                  is the same as the one that is already in the database.
    21462148 */
    21472149function update_post_meta( $post_id, $meta_key, $meta_value, $prev_value = '' ) {
Note: See TracChangeset for help on using the changeset viewer.