diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index 1fb08a4520895..ad660a665ea6d 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/wp-includes/class-wp-query.php @@ -1299,12 +1299,9 @@ public function parse_tax_query( &$q ) { } // If query string 'tag' is array, implode it. - if ( ! is_array( $q['tag'] ) ) { - $q['tag'] = explode( ',', $q['tag'] ); - $q['tag'] = array_map( 'trim', $q['tag'] ); + if ( is_array( $q['tag'] ) ) { + $q['tag'] = implode( ',', $q['tag'] ); } - sort( $q['tag'] ); - $q['tag'] = implode( ',', $q['tag'] ); // Tag stuff.