mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-27 06:42:56 +02:00
Calculate term count using $wp_query->tax_query. See #12891
git-svn-id: http://svn.automattic.com/wordpress/trunk@15615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
271aa55c16
commit
692b43a71b
@ -150,9 +150,8 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
|
|||||||
} elseif ( is_category() || is_tag() || is_tax() ) { // Terms (Tags/categories)
|
} elseif ( is_category() || is_tag() || is_tax() ) { // Terms (Tags/categories)
|
||||||
|
|
||||||
$term_count = 0;
|
$term_count = 0;
|
||||||
foreach ( array('category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in',
|
foreach ( $wp_query->tax_query as $tax_query )
|
||||||
'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and') as $key )
|
$term_count += count( $tax_query['terms'] );
|
||||||
$term_count += count($wp_query->query_vars[$key]);
|
|
||||||
|
|
||||||
$obj = $wp_query->get_queried_object();
|
$obj = $wp_query->get_queried_object();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user