Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

register_meta()

3 tags 1 category

register_meta() — Registers a meta key. It is recommended to register meta keys for a specific combination of object type and object subtype. If passing an object subtype is omitted, the meta key will be registered for the entire object type, however it can be partly overridden in case a more specific meta key of the same name exists for the same object type and a subtype. If an object type does not support any subtypes, such as blogs, users, or comments, you should commonly call this function without passing a subtype.

Inputs: $object_type (string): Type of object metadata is for. Accepts ‘blog’, ‘post’, ‘comment’, ‘term’, ‘user’, or any other object type with an associated meta table. $meta_key (string): Meta key to register. $args (array): Data used to describe the meta key when registered. Field $object_subtype (string): A subtype; e.g. if the object type is “post”, the post type. If left empty, the meta key will be registered on the entire object type. Default empty. Field $type (string): The type of data associated with this meta key. Valid values are ‘string’, ‘boolean’, ‘integer’, ‘number’, ‘array’, and ‘object’. Field $label (string): A human-readable label of the data attached to this meta key. Field $description (string): A description of the data attached to this meta key. Field $single (bool): Whether the meta key has one value per object, or an array of values per object. $deprecated (string|array): Deprecated. Use $args instead.

Returns bool: True if the meta key was successfully registered in the global array, false if not. Registering a meta key with distinct sanitize and auth callbacks will fire those callbacks, but will not add to the global registry.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…