mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 15:47:38 +02:00
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:
parent
47742eae12
commit
af026330c4
@ -1295,7 +1295,7 @@ function get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') {
|
|||||||
$term = $term->term_id;
|
$term = $term->term_id;
|
||||||
if ( !$term = (int) $term )
|
if ( !$term = (int) $term )
|
||||||
return null;
|
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) );
|
$_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 )
|
if ( ! $_term )
|
||||||
return null;
|
return null;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user