Checks if a meta key is registered.
Parameters
$object_type
stringrequired- Type of object metadata is for. Accepts
'post'
,'comment'
,'term'
,'user'
, or any other object type with an associated meta table. $meta_key
stringrequired- Metadata key.
$object_subtype
stringoptional- The subtype of the object type.
Default:
''
Source
function registered_meta_key_exists( $object_type, $meta_key, $object_subtype = '' ) {
$meta_keys = get_registered_meta_keys( $object_type, $object_subtype );
return isset( $meta_keys[ $meta_key ] );
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.