From df21fa1cc64120df2b3a452dae92cbb047e4e66d Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 21 Sep 2012 13:27:56 +0000 Subject: [PATCH] Pass a term object to the delete_term actions. Props bigdawggi. fixes #20645 git-svn-id: http://core.svn.wordpress.org/trunk@21939 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index c4d49dff6a..a0f87d7a23 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1817,6 +1817,9 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) { foreach ( $tax_object->object_type as $object_type ) clean_object_term_cache( $objects, $object_type ); + // Get the object before deletion so we can pass to actions below + $deleted_term = get_term( $term, $taxonomy ); + do_action( 'delete_term_taxonomy', $tt_id ); $wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $tt_id ) ); do_action( 'deleted_term_taxonomy', $tt_id ); @@ -1827,8 +1830,8 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) { clean_term_cache($term, $taxonomy); - do_action('delete_term', $term, $tt_id, $taxonomy); - do_action("delete_$taxonomy", $term, $tt_id); + do_action( 'delete_term', $term, $tt_id, $taxonomy, $deleted_term ); + do_action( "delete_$taxonomy", $term, $tt_id, $deleted_term ); return true; }