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 filter names include: <ul> <li>get_post_metadata</li> <li>get_comment_metadata</li> <li>get_term_metadata</li> <li>get_user_metadata</li> </ul>
Parameters
$valuemixed
The value to return, either a single metadata value or an array of values depending on the value of $single. Default null.
$object_idint
ID of the object metadata is for.
$meta_keystring
Metadata key.
$singlebool
Whether to return only the first value of the specified $meta_key.
$meta_typestring
Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.
630* @param int$object_idID of the object metadata is for.631* @param string$meta_key Metadata key.632* @param bool$single Whether to return only the first value of the specified `$meta_key`.633* @param string$meta_type Type of object metadata is for. Accepts 'post','comment','term','user',634*or any other object type with an associated meta table.635*/636$check=apply_filters("get_{$meta_type}_metadata",null,$object_id,$meta_key,$single,$meta_type);637if(null!==$check){638if($single&&is_array($check)){639return$check[0];640}else{641return$check;642}
History
Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.