wppaste
WordPress

do_action( 'delete_term', int $term, int $tt_id, string $taxonomy, WP_Term $deleted_term, array $object_ids )

Since
2.5.0, 4.5.0
Fires after a term is deleted from the database and the cache is cleaned.

Description

The 'delete_$taxonomy' hook is also available for targeting a specific taxonomy.

Compatibility

WordPress
since 4.5.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$termint
Term ID.
$tt_idint
Term taxonomy ID.
$taxonomystring
Taxonomy slug.
$deleted_termWP_Term
Copy of the already-deleted term.
$object_idsarray
List of term object IDs.

Where this hook fires · 1

  • wp-includes/taxonomy.php:2212wp_delete_term()

Source code

	 * @param int     $term         Term ID.	 * @param int     $tt_id        Term taxonomy ID.	 * @param string  $taxonomy     Taxonomy slug.	 * @param WP_Term $deleted_term Copy of the already-deleted term.	 * @param array   $object_ids   List of term object IDs.	 */	do_action( 'delete_term', $term, $tt_id, $taxonomy, $deleted_term, $object_ids ); 	/**	 * Fires after a term in a specific taxonomy is deleted.	 *	 * The dynamic portion of the hook name, `$taxonomy`, refers to the specific	 * taxonomy the term belonged to.

Changelog

Introduced in 4.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

4.5.0
Introduced the $object_ids argument.from the docblock
2.5.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.