Ticket #21864: return_meta_id.patch
File return_meta_id.patch, 2.4 KB (added by , 13 years ago) |
---|
-
wp-includes/comment.php
504 504 * @param string $meta_key Metadata name. 505 505 * @param mixed $meta_value Metadata value. 506 506 * @param bool $unique Optional, default is false. Whether the same key should not be added. 507 * @return bool False for failure. True for success.507 * @return bool The meta ID on successful update, false on failure. 508 508 */ 509 509 function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) { 510 510 return add_metadata('comment', $comment_id, $meta_key, $meta_value, $unique); -
wp-includes/comment.php
504 504 * @param string $meta_key Metadata name. 505 505 * @param mixed $meta_value Metadata value. 506 506 * @param bool $unique Optional, default is false. Whether the same key should not be added. 507 * @return bool False for failure. True for success.507 * @return bool The meta ID on successful update, false on failure. 508 508 */ 509 509 function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) { 510 510 return add_metadata('comment', $comment_id, $meta_key, $meta_value, $unique); -
wp-includes/meta.php
96 96 * @param string $meta_value Metadata value 97 97 * @param string $prev_value Optional. If specified, only update existing metadata entries with 98 98 * the specified value. Otherwise, update all entries. 99 * @return bool T rueon successful update, false on failure.99 * @return bool The meta ID on successful update, false on failure. 100 100 */ 101 101 function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '') { 102 102 if ( !$meta_type || !$meta_key ) … … 160 160 if ( 'post' == $meta_type ) 161 161 do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value ); 162 162 163 return true;163 return $meta_id; 164 164 } 165 165 166 166 /** -
wp-includes/post.php
1479 1479 * @param string $meta_key Metadata name. 1480 1480 * @param mixed $meta_value Metadata value. 1481 1481 * @param bool $unique Optional, default is false. Whether the same key should not be added. 1482 * @return bool False for failure. True for success.1482 * @return bool The meta ID on successful update, false on failure. 1483 1483 */ 1484 1484 function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) { 1485 1485 // make sure meta is added to the post, not a revision