mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +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:
@@ -1274,10 +1274,12 @@ function get_term_meta( $term_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|WP_Error Meta ID if the key didn't exist. true on successful update,
|
||||
* false on failure. WP_Error when term_id is ambiguous
|
||||
* between taxonomies.
|
||||
* false on failure or if the value passed to the function
|
||||
* is the same as the one that is already in the database.
|
||||
* WP_Error when term_id is ambiguous between taxonomies.
|
||||
*/
|
||||
function update_term_meta( $term_id, $meta_key, $meta_value, $prev_value = '' ) {
|
||||
if ( wp_term_is_shared( $term_id ) ) {
|
||||
|
||||
Reference in New Issue
Block a user