register_meta


register_meta ( $object_type, $meta_key, $args, $deprecated = null )

Parameters:
  • (string) $object_type Type of object this meta is registered to.
  • (string) $meta_key Meta key to register.
  • (array) $args { Data used to describe the meta key when registered.
  • (string|array) $deprecated 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.
Defined at:
Change Log:
  • 4: .
  • 4: .

Description

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 users or comments, you should commonly call this function without passing a subtype.

Related Functions

register_term_meta, register_post_meta, unregister_meta_key, register_widget, unregister_post_meta

Top Google Results

User discussions

wpseek mobile