register_meta_args
Filters the registration arguments when registering meta.
Usage
add_filter( 'register_meta_args', 'wp_kama_register_meta_args_filter', 10, 4 ); /** * Function for `register_meta_args` filter-hook. * * @param array $args Array of meta registration arguments. * @param array $defaults Array of default arguments. * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table. * @param string $meta_key Meta key. * * @return array */ function wp_kama_register_meta_args_filter( $args, $defaults, $object_type, $meta_key ){ // filter... return $args; }
- $args(array)
- Array of meta registration arguments.
- $defaults(array)
- Array of default arguments.
- $object_type(string)
- Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.
- $meta_key(string)
- Meta key.
Changelog
Since 4.6.0 | Introduced. |
Where the hook is called
register_meta_args
wp-includes/meta.php 1453
$args = apply_filters( 'register_meta_args', $args, $defaults, $object_type, $meta_key );
Where the hook is used in WordPress
wp-includes/default-filters.php 104
add_filter( 'register_meta_args', '_wp_register_meta_args_allowed_list', 10, 2 );