From 8a95b13cab05cd27c640d2719b00e298fff7b01e Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 24 Aug 2015 21:22:26 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@33724 git-svn-id: http://core.svn.wordpress.org/trunk@33691 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 10 ++++++++++ wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 92fbb4febd..ecebd221c5 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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 ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 96b3f388b5..d3e901f8b1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-33723'; +$wp_version = '4.4-alpha-33724'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.