added_(meta_type)_meta action-hook . WP 2.9.0
Fires immediately after 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( 'added_(meta_type)_meta', 'action_function_name_9043', 10, 4 ); function action_function_name_9043( $mid, $object_id, $meta_key, $_meta_value ){ // action... }
- $mid(int)
- The meta ID after successful update.
- $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 2.9.0 | Introduced. |
Where the hook is called
wp-includes/meta.php 133
do_action( "added_{$meta_type}_meta", $mid, $object_id, $meta_key, $_meta_value );
Where in WP core the hook is used WordPress
wp-includes/meta.php 102
add_action( 'added_post_meta', 'wp_cache_set_posts_last_changed' );
wp-includes/meta.php 107
add_action( 'added_term_meta', 'wp_cache_set_terms_last_changed' );
wp-includes/meta.php 120
add_action( 'added_comment_meta', 'wp_cache_set_comments_last_changed' );
wp-includes/meta.php 58
add_action( 'added_blog_meta', 'wp_cache_set_sites_last_changed' );