delete_term action-hook . WP 2.5.0
Fires after a term is deleted from the database and the cache is cleaned.
The 'delete_(taxonomy)' hook is also available for targeting a specific taxonomy.
Usage
add_action( 'delete_term', 'action_function_name_8420', 10, 5 ); function action_function_name_8420( $term, $tt_id, $taxonomy, $deleted_term, $object_ids ){ // action... }
- $term(int)
- Term ID.
- $tt_id(int)
- Term taxonomy ID.
- $taxonomy(string)
- Taxonomy slug.
- $deleted_term(WP_Term)
- Copy of the already-deleted term.
- $object_ids(array)
- List of term object IDs.
Changelog
Since 2.5.0 | Introduced. |
Since 4.5.0 | Introduced the $object_ids argument. |
Where the hook is called
delete_term
wp-includes/taxonomy.php 2004
do_action( 'delete_term', $term, $tt_id, $taxonomy, $deleted_term, $object_ids );
Where in WP core the hook is used WordPress
wp-includes/taxonomy.php 391
add_action( 'delete_term', '_wp_delete_tax_menu_item', 10, 3 );