Home > AI > Backend > Wordpress >

metadata_exists

metadata_exists( string $meta_type, int $object_id, string $meta_key )

Determines if a meta field with the given key exists for the given object ID.

Parameters
$meta_type
(string) (Required) Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table. 
The name is for database tables, not customized post type.

$object_id
(int) (Required) ID of the object metadata is for.

$meta_key
(string) (Required) Metadata key.

Leave a Reply