In WP_Query::parse_tax_query(), allow 'cat' and 'tag' querystrings to be formatted as arrays.

See [33095] #32454 for a previous fix related to custom taxonomies.

Props Veraxus.
Fixes #33532.

git-svn-id: https://develop.svn.wordpress.org/trunk@33724 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2015-08-24 21:21:49 +00:00
parent 5f3879e37c
commit 32cd95e1c1
2 changed files with 215 additions and 0 deletions

View File

@@ -1891,6 +1891,11 @@ class WP_Query {
}
}
// If querystring 'cat' is an array, implode it.
if ( is_array( $q['cat'] ) ) {
$q['cat'] = implode( ',', $q['cat'] );
}
// Category stuff
if ( ! empty( $q['cat'] ) && ! $this->is_singular ) {
$cat_in = $cat_not_in = array();
@@ -1966,6 +1971,11 @@ class WP_Query {
);
}
// If querystring 'tag' is array, implode it.
if ( is_array( $q['tag'] ) ) {
$q['tag'] = implode( ',', $q['tag'] );
}
// Tag stuff
if ( '' != $q['tag'] && !$this->is_singular && $this->query_vars_changed ) {
if ( strpos($q['tag'], ',') !== false ) {