Introduce 'pre_delete_term'
hook.
Props cmmarslender. Fixes #30127. git-svn-id: https://develop.svn.wordpress.org/trunk@30088 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d62320bff5
commit
c3a3fc5a79
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user