WordPress.org

Make WordPress Core

Changeset 15615


Ignore:
Timestamp:
09/14/10 11:34:40 (7 years ago)
Author:
scribu
Message:

Calculate term count using $wp_query->tax_query. See #12891

File:
1 edited

Legend:

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

    r15582 r15615  
    151151 
    152152            $term_count = 0; 
    153             foreach ( array('category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in', 
    154             'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and') as $key ) 
    155                 $term_count += count($wp_query->query_vars[$key]); 
     153            foreach ( $wp_query->tax_query as $tax_query ) 
     154                $term_count += count( $tax_query['terms'] ); 
    156155 
    157156            $obj = $wp_query->get_queried_object(); 
Note: See TracChangeset for help on using the changeset viewer.