delete_post_tag action-hookWP 2.3.0

Fires after a term in a specific taxonomy is deleted.

This is one of the variants of the dynamic hook delete_(taxonomy)

Usage

add_action( 'delete_post_tag', 'wp_kama_delete_post_tag_action', 10, 4 );

/**
 * Function for `delete_post_tag` action-hook.
 * 
 * @param int     $term         Term ID.
 * @param int     $tt_id        Term taxonomy ID.
 * @param WP_Term $deleted_term Copy of the already-deleted term.
 * @param array   $object_ids   List of term object IDs.
 *
 * @return void
 */
function wp_kama_delete_post_tag_action( $term, $tt_id, $deleted_term, $object_ids ){

	// action...
}
$term(int)
Term ID.
$tt_id(int)
Term taxonomy ID.
$deleted_term(WP_Term)
Copy of the already-deleted term.
$object_ids(array)
List of term object IDs.

Changelog

Since 2.3.0 Introduced.
Since 4.5.0 Introduced the $object_ids argument.

Where the hook is called

wp_delete_term()
delete_post_tag
wp-includes/taxonomy.php 2208
do_action( "delete_{$taxonomy}", $term, $tt_id, $deleted_term, $object_ids );

Where the hook is used in WordPress

Usage not found.