deleted_(meta_type)_meta action-hookWP 2.9.0

Fires immediately after deleting metadata of a specific type.

The dynamic portion of the hook name, $meta_type, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table).

Possible hook names include:


add_action( 'deleted_(meta_type)_meta', 'wp_kama_deleted_meta_type_action', 10, 4 );

 * Function for `deleted_(meta_type)_meta` action-hook.
 * @param string[] $meta_ids    An array of metadata entry IDs to delete.
 * @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_deleted_meta_type_action( $meta_ids, $object_id, $meta_key, $_meta_value ){

	// action...
An array of metadata entry IDs to delete.
ID of the object metadata is for.
Metadata key.
Metadata value.


Since 2.9.0 Introduced.

Where the hook is called

wp-includes/meta.php 528
do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
wp-includes/meta.php 1067
do_action( "deleted_{$meta_type}_meta", (array) $meta_id, $object_id, $meta->meta_key, $meta->meta_value );

Where the hook is used in WordPress

wp-includes/default-filters.php 116
add_action( 'deleted_post_meta', 'wp_cache_set_posts_last_changed' );
wp-includes/default-filters.php 121
add_action( 'deleted_user_meta', 'wp_cache_set_users_last_changed' );
wp-includes/default-filters.php 129
add_action( 'deleted_term_meta', 'wp_cache_set_terms_last_changed' );
wp-includes/default-filters.php 142
add_action( 'deleted_comment_meta', 'wp_cache_set_comments_last_changed' );
wp-includes/ms-default-filters.php 60
add_action( 'deleted_blog_meta', 'wp_cache_set_sites_last_changed' );