Make WordPress Core

Changeset 27191


Ignore:
Timestamp:
02/18/2014 09:35:07 PM (10 years ago)
Author:
SergeyBiryukov
Message:

Correct return values for update_metadata() and related functions.

fixes #21864.

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

Legend:

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

    r27115 r27191  
    649649 * @param mixed $meta_value Metadata value.
    650650 * @param mixed $prev_value Optional. Previous value to check before removing.
    651  * @return bool True on success, false on failure.
     651 * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
    652652 */
    653653function update_comment_meta($comment_id, $meta_key, $meta_value, $prev_value = '') {
  • trunk/src/wp-includes/meta.php

    r26307 r27191  
    2727 *      unique for the object. If true, and the object already has a value for the specified
    2828 *      metadata key, no change will be made
    29  * @return int|bool The meta ID on successful update, false on failure.
     29 * @return int|bool The meta ID on success, false on failure.
    3030 */
    3131function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = false) {
     
    9797 * @param mixed $prev_value Optional. If specified, only update existing metadata entries with
    9898 *      the specified value. Otherwise, update all entries.
    99  * @return bool True on successful update, false on failure.
     99 * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
    100100 */
    101101function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '') {
  • trunk/src/wp-includes/post.php

    r27138 r27191  
    17901790 * @param mixed $meta_value Metadata value. Must be serializable if non-scalar.
    17911791 * @param mixed $prev_value Optional. Previous value to check before removing.
    1792  * @return bool True on success, false on failure.
     1792 * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
    17931793 */
    17941794function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') {
  • trunk/src/wp-includes/user.php

    r27185 r27191  
    994994 * @param mixed $meta_value Metadata value.
    995995 * @param mixed $prev_value Optional. Previous value to check before removing.
    996  * @return bool True on success, false on failure.
     996 * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
    997997 */
    998998function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '') {
Note: See TracChangeset for help on using the changeset viewer.