From 6ffb0e718e263bea5c228d065edb7e9dea59a1a8 Mon Sep 17 00:00:00 2001 From: scribu Date: Tue, 14 Sep 2010 11:34:40 +0000 Subject: [PATCH] Calculate term count using $wp_query->tax_query. See #12891 git-svn-id: https://develop.svn.wordpress.org/trunk@15615 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/canonical.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index cf8bcb4a08..476b63ecbe 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -150,9 +150,8 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { } elseif ( is_category() || is_tag() || is_tax() ) { // Terms (Tags/categories) $term_count = 0; - foreach ( array('category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in', - 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and') as $key ) - $term_count += count($wp_query->query_vars[$key]); + foreach ( $wp_query->tax_query as $tax_query ) + $term_count += count( $tax_query['terms'] ); $obj = $wp_query->get_queried_object();