add_(meta_type)_meta
Fires immediately before meta of a specific type is added.
The dynamic portion of the hook name, $meta_type, refers to the meta object type (blog, post, comment, term, user, or any other type with an associated meta table).
Possible hook names include:
Usage
add_action( 'add_(meta_type)_meta', 'wp_kama_add_meta_type_action', 10, 3 );
/**
* Function for `add_(meta_type)_meta` action-hook.
*
* @param int $object_id ID of the object metadata is for.
* @param string $meta_key Metadata key.
* @param mixed $_meta_value Metadata value.
*
* @return void
*/
function wp_kama_add_meta_type_action( $object_id, $meta_key, $_meta_value ){
// action...
}
- $object_id(int)
- ID of the object metadata is for.
- $meta_key(string)
- Metadata key.
- $_meta_value(mixed)
- Metadata value.
Changelog
| Since 3.1.0 | Introduced. |
Where the hook is called
add_(meta_type)_meta
wp-includes/meta.php 128
do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value );