mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Docs: Improve documentation for the $prev_value parameter and return result of various metadata update functions.
Props stevenlinx. Fixes #50502. See #49572. git-svn-id: https://develop.svn.wordpress.org/trunk@48214 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -517,9 +517,11 @@ function get_comment_meta( $comment_id, $key = '', $single = false ) {
|
||||
* @param string $meta_key Metadata key.
|
||||
* @param mixed $meta_value Metadata value. Must be serializable if non-scalar.
|
||||
* @param mixed $prev_value Optional. Previous value to check before updating.
|
||||
* Default empty.
|
||||
* If specified, only update existing metadata entries with
|
||||
* this value. Otherwise, update all entries. Default empty.
|
||||
* @return int|bool Meta ID if the key didn't exist, true on successful update,
|
||||
* false on failure.
|
||||
* false on failure or if the value passed to the function
|
||||
* is the same as the one that is already in the database.
|
||||
*/
|
||||
function update_comment_meta( $comment_id, $meta_key, $meta_value, $prev_value = '' ) {
|
||||
return update_metadata( 'comment', $comment_id, $meta_key, $meta_value, $prev_value );
|
||||
|
||||
Reference in New Issue
Block a user