From af026330c4ae84d15f47c4105786229a085ff3f1 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 30 Oct 2014 02:50:23 +0000 Subject: [PATCH] Clean up `get_term_by()` caching. * Fix cache key/group modification that was missed in [30073]. * Update unit tests to reflect new key/group format. Props tollmanz. Fixes #21760. Built from https://develop.svn.wordpress.org/trunk@30108 git-svn-id: http://core.svn.wordpress.org/trunk@30108 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index d8abfc00fa..b9b804235e 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1295,7 +1295,7 @@ function get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { $term = $term->term_id; if ( !$term = (int) $term ) return null; - if ( ! $_term = wp_cache_get($term, $taxonomy) ) { + if ( ! $_term = wp_cache_get( $term, $taxonomy . ':terms:' . $incrementor ) ) { $_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND t.term_id = %d LIMIT 1", $taxonomy, $term) ); if ( ! $_term ) return null; diff --git a/wp-includes/version.php b/wp-includes/version.php index 5c54f7f5b0..f8acb9f0eb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-alpha-30107'; +$wp_version = '4.1-alpha-30108'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.