delete_post_tag
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
delete_post_tag
wp-includes/taxonomy.php 2215
do_action( "delete_{$taxonomy}", $term, $tt_id, $deleted_term, $object_ids );