delete_<taxonomy>
Fires after a term in a specific taxonomy is deleted.
Description
do_action( 'delete_<taxonomy>', (int) $term, (int) $tt_id, (mixed) $deleted_term, (array) $object_ids );
The dynamic portion(s) of the hook name refer to the specific taxonomy the term belonged to.
Parameters (4)
- 0. $term (int)
- The term.
- 1. $tt_id (int)
- Term taxonomy ID.
- 2. $deleted_term (mixed)
- Copy of the already-deleted term, in the form specified by the parent function.
WP_Error
otherwise. - 3. $object_ids (array)
- List of term object IDs.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'delete_{$taxonomy}', $term, $tt_id, $deleted_term, $object_ids );
- The following example is for adding a hook callback.
- // define the delete_<taxonomy> callback
- function action_delete_taxonomy( $term, $tt_id, $deleted_term, $object_ids ) {
- // make action magic happen here...
- };
- // add the action
- add_action( "delete_{$taxonomy}", 'action_delete_taxonomy', 10, 4 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( "delete_{$taxonomy}", 'action_delete_taxonomy', 10, 4 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/taxonomy.php
- do_action( "delete_{$taxonomy}", $term, $tt_id, $deleted_term, $object_ids );