add_(meta_type)_meta action-hook . WP 3.1.0
Fires immediately before meta of a specific type is added.
The dynamic portion of the hook, $meta_type, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).
Usage
add_action( 'add_(meta_type)_meta', 'action_function_name_9010', 10, 3 ); function action_function_name_9010( $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. Serialized if non-scalar.
Changelog
Since 3.1.0 | Introduced. |
Where the hook is called
wp-includes/meta.php 101
do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value );