registered_meta_key_exists() – Checks if a meta key is registered.
You appear to be a bot. Output may be restricted
Description
Checks if a meta key is registered.
Usage
$bool = registered_meta_key_exists( $object_type, $meta_key, $object_subtype );
Parameters
- $object_type
- ( string ) required – Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.
- $meta_key
- ( string ) required – Metadata key.
- $object_subtype
- ( string ) optional – Optional. The subtype of the object type. Default empty string.
Returns
bool True if the meta key is registered to the object type and, if provided, the object subtype. False if not.
Source
File name: wordpress/wp-includes/meta.php
Lines:
1 to 5 of 5
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 ] ); }