delete_term WordPress Action Hook

The delete_term hook is called when a term is deleted. It allows you to take an action when a term is deleted.

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

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.


Top ↑

Parameters

$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.


Top ↑

Source

File: wp-includes/taxonomy.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.5.0Introduced the $object_ids argument.
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More