Make WordPress Core


Ignore:
Timestamp:
10/30/2014 02:49:51 AM (11 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r30107 r30108  
    12961296        if ( !$term = (int) $term )
    12971297            return null;
    1298         if ( ! $_term = wp_cache_get($term, $taxonomy) ) {
     1298        if ( ! $_term = wp_cache_get( $term, $taxonomy . ':terms:' . $incrementor ) ) {
    12991299            $_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) );
    13001300            if ( ! $_term )
Note: See TracChangeset for help on using the changeset viewer.