Short-circuits updating metadata of a specific type.
Description
The dynamic portion of the hook name, $meta_type, refers to the meta object type (blog, 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_blog_metadata</li> <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.
244* @param string$meta_key Metadata key.245* @param mixed$meta_value Metadata value. Must be serializable if non-scalar.246* @param mixed$prev_value Optional. Previous value to check before updating.247*If specified, only update existing metadata entries with248* this value. Otherwise, update all entries.249*/250$check=apply_filters("update_{$meta_type}_metadata",null,$object_id,$meta_key,$meta_value,$prev_value);251if(null!==$check){252return(bool)$check;253}254255// Compare existing value to new value if no prev value given and the key exists only once.256if(empty($prev_value)){
History
Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.