Make WordPress Core


Ignore:
Timestamp:
10/12/2016 03:29:03 PM (10 years ago)
Author:
boonebgorges
Message:

Taxonomy: Cache results of term count queries.

Fixes #38295.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-term-query.php

    r38768 r38784  
    691691
    692692                if ( 'count' == $_fields ) {
    693                         return $wpdb->get_var( $this->request );
     693                        $count = $wpdb->get_var( $this->request );
     694                        wp_cache_set( $cache_key, $count, 'terms' );
     695                        return $count;
    694696                }
    695697
Note: See TracChangeset for help on using the changeset viewer.