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: http://svn.automattic.com/wordpress/trunk@16513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
36658f37ca
commit
66d34fa710
|
@ -12,6 +12,7 @@ if ( !isset($wp_did_header) ) {
|
|||
require_once( dirname(__FILE__) . '/wp-load.php' );
|
||||
|
||||
wp();
|
||||
//echo '<pre>'; print_r($wp_query); echo '</pre>'; exit;
|
||||
|
||||
require_once( ABSPATH . WPINC . '/template-loader.php' );
|
||||
|
||||
|
|
|
@ -1546,6 +1546,7 @@ class WP_Query {
|
|||
}
|
||||
|
||||
if ( !empty($q['category__in']) ) {
|
||||
$q['category__in'] = array_unique( $q['category__in'] );
|
||||
$tax_query[] = array(
|
||||
'taxonomy' => 'category',
|
||||
'terms' => $q['category__in'],
|
||||
|
@ -1555,6 +1556,7 @@ class WP_Query {
|
|||
}
|
||||
|
||||
if ( !empty($q['category__not_in']) ) {
|
||||
$q['category__not_in'] = array_unique( $q['category__not_in'] );
|
||||
$tax_query[] = array(
|
||||
'taxonomy' => 'category',
|
||||
'terms' => $q['category__not_in'],
|
||||
|
|
Loading…
Reference in New Issue