From c3a3fc5a79bccf6acb3f571ca29daa7d32fe2dc6 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 29 Oct 2014 02:43:33 +0000 Subject: [PATCH] Introduce `'pre_delete_term'` hook. Props cmmarslender. Fixes #30127. git-svn-id: https://develop.svn.wordpress.org/trunk@30088 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index cbe3e1ee6c..e967503b17 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -2417,6 +2417,16 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) { $force_default = $args['force_default']; } + /** + * 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);