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
This commit is contained in:
Boone Gorges 2014-10-30 02:50:23 +00:00
parent 47742eae12
commit af026330c4
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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.