WPDev.one
Core Function
View Source on Trac ↗

registered_meta_key_exists()

registered_meta_key_exists( mixed $object_type, mixed $meta_key, mixed $object_subtype = '' )

Checks if a meta key is registered.

Parameters 2 required

Name / Type Description
string

$object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.

Required
$meta_key
string

Metadata key.

Required
$object_subtype
string

Optional. The subtype of the object type. Default empty string.

Return Value

(bool)
bool True if the meta key is registered to the object type and, if provided, the object subtype. False if not.

Function Information

Since Version
4.6.0
Source File
wp-includes/meta.php
Advertisement