Make WordPress Core


Ignore:
Timestamp:
11/02/2007 04:31:44 AM (19 years ago)
Author:
ryan
Message:

Cache get_terms queries that return nothing.

File:
1 edited

Legend:

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

    r6295 r6307  
    641641        }
    642642
    643         if ( empty($terms) )
    644                 return array();
     643        if ( empty($terms) ) {
     644                $cache[ $key ] = array();
     645                wp_cache_set( 'get_terms', $cache, 'terms' );
     646                return apply_filters('get_terms', array(), $taxonomies, $args);
     647        }
    645648
    646649        if ( $child_of || $hierarchical ) {
Note: See TracChangeset for help on using the changeset viewer.