Core Function
View Source on Trac ↗ register_meta()
register_meta( mixed $object_type, mixed $meta_key, mixed $args, mixed $deprecated = null ) Registers a meta key.
Parameters 4 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 | Meta key to register. Required |
| array | $args { Data used to describe the meta key when registered. Required |
| (string | | array) $deprecated Deprecated. Use `$args` instead. Required |
Return Value
(bool)
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.
Function Information
Since Version
3.3.0
Source File
wp-includes/meta.php
Advertisement