From e89d237b86f707c362b45a731a4d86c4b5dc4511 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 23 Feb 2015 21:08:26 +0000 Subject: [PATCH] Pass taxonomy name, not object, to 'edit_term_taxonomy' and 'edited_term_taxonomy' actions. These actions are fired in a number of different places, and in some cases the tax name is passed, while in others the taxonomy object is passed. This inconsistency made it difficult for plugins to use the `$taxonomy` value. Props ipm-frommen. Fixes #30999. Built from https://develop.svn.wordpress.org/trunk@31525 git-svn-id: http://core.svn.wordpress.org/trunk@31506 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 8 ++++---- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 71c422d60b..cf545fb7a3 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -4062,11 +4062,11 @@ function _update_post_term_count( $terms, $taxonomy ) { $count += (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type IN ('" . implode("', '", $object_types ) . "') AND term_taxonomy_id = %d", $term ) ); /** This action is documented in wp-includes/taxonomy.php */ - do_action( 'edit_term_taxonomy', $term, $taxonomy ); + do_action( 'edit_term_taxonomy', $term, $taxonomy->name ); $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) ); /** This action is documented in wp-includes/taxonomy.php */ - do_action( 'edited_term_taxonomy', $term, $taxonomy ); + do_action( 'edited_term_taxonomy', $term, $taxonomy->name ); } } @@ -4089,11 +4089,11 @@ function _update_generic_term_count( $terms, $taxonomy ) { $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term ) ); /** This action is documented in wp-includes/taxonomy.php */ - do_action( 'edit_term_taxonomy', $term, $taxonomy ); + do_action( 'edit_term_taxonomy', $term, $taxonomy->name ); $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) ); /** This action is documented in wp-includes/taxonomy.php */ - do_action( 'edited_term_taxonomy', $term, $taxonomy ); + do_action( 'edited_term_taxonomy', $term, $taxonomy->name ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index b6790ea886..7ef678c2b3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31524'; +$wp_version = '4.2-alpha-31525'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.