From 0c49be0c940aff41a7bbc52a448c369df89e7be1 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 4 Oct 2024 11:13:19 +1000 Subject: [PATCH] Fix the tag. --- src/wp-includes/class-wp-query.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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.