wphooks.info - pre_delete_term

pre_delete_term

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/taxonomy.php:
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
	}

	/**
	 * Fires when deleting a term, before any modifications are made to posts or terms.
	 *
	 * @since 4.1.0
	 *
	 * @param int    $term     Term ID.
	 * @param string $taxonomy Taxonomy Name.
	 */
	do_action( 'pre_delete_term', $term, $taxonomy );

	// Update children to point to new parent
	if ( is_taxonomy_hierarchical( $taxonomy ) ) {
		$term_obj = get_term( $term, $taxonomy );
		if ( is_wp_error( $term_obj ) ) {
			return $term_obj;
		}
		$parent = $term_obj->parent;