array_unique() category__in and category__not_in to eliminate dupes from multiple runs of parse_tax_query(). Fixes canonical redirects for cat, category__in, and category__not_in requests. see #12891 #15487
git-svn-id: https://develop.svn.wordpress.org/trunk@16513 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a825250771
commit
f3e3c03abe
|
@ -12,6 +12,7 @@ if ( !isset($wp_did_header) ) {
|
||||||
require_once( dirname(__FILE__) . '/wp-load.php' );
|
require_once( dirname(__FILE__) . '/wp-load.php' );
|
||||||
|
|
||||||
wp();
|
wp();
|
||||||
|
//echo '<pre>'; print_r($wp_query); echo '</pre>'; exit;
|
||||||
|
|
||||||
require_once( ABSPATH . WPINC . '/template-loader.php' );
|
require_once( ABSPATH . WPINC . '/template-loader.php' );
|
||||||
|
|
||||||
|
|
|
@ -1546,6 +1546,7 @@ class WP_Query {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !empty($q['category__in']) ) {
|
if ( !empty($q['category__in']) ) {
|
||||||
|
$q['category__in'] = array_unique( $q['category__in'] );
|
||||||
$tax_query[] = array(
|
$tax_query[] = array(
|
||||||
'taxonomy' => 'category',
|
'taxonomy' => 'category',
|
||||||
'terms' => $q['category__in'],
|
'terms' => $q['category__in'],
|
||||||
|
@ -1555,6 +1556,7 @@ class WP_Query {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !empty($q['category__not_in']) ) {
|
if ( !empty($q['category__not_in']) ) {
|
||||||
|
$q['category__not_in'] = array_unique( $q['category__not_in'] );
|
||||||
$tax_query[] = array(
|
$tax_query[] = array(
|
||||||
'taxonomy' => 'category',
|
'taxonomy' => 'category',
|
||||||
'terms' => $q['category__not_in'],
|
'terms' => $q['category__not_in'],
|
||||||
|
|
Loading…
Reference in New Issue