Short-circuits updating metadata of a specific type.
Description
The dynamic portion of the hook name, $meta_type, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).Returning a non-null value will effectively short-circuit the function. Possible hook names include: <ul> <li>update_post_metadata</li> <li>update_comment_metadata</li> <li>update_term_metadata</li> <li>update_user_metadata</li> </ul>
Parameters
$checknull|bool
Whether to allow updating metadata for the given type.
$object_idint
ID of the object metadata is for.
$meta_keystring
Metadata key.
$meta_valuemixed
Metadata value. Must be serializable if non-scalar.
$prev_valuemixed
Previous value to check before updating. If specified, only update existing metadata entries with this value. Otherwise, update all entries.
229* @param string$meta_key Metadata key.230* @param mixed$meta_value Metadata value. Must be serializable if non-scalar.231* @param mixed$prev_value Optional. Previous value to check before updating.232*If specified, only update existing metadata entries with233* this value. Otherwise, update all entries.234*/235$check=apply_filters("update_{$meta_type}_metadata",null,$object_id,$meta_key,$meta_value,$prev_value);236if(null!==$check){237return(bool)$check;238}239240// Compare existing value to new value if no prev value given and the key exists only once.241if(empty($prev_value)){
History
Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.