From b4a082e7875153e975e9acf41eeb199c17d81388 Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Fri, 26 Jul 2024 09:57:18 +1200 Subject: [PATCH] 2024 Theme: Remove language filter for searches Searches are language specific so a language filter is mostly unnecessary. Temporary fix for #2577 --- wp-content/themes/pub/wporg-learn-2024/inc/block-config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-content/themes/pub/wporg-learn-2024/inc/block-config.php b/wp-content/themes/pub/wporg-learn-2024/inc/block-config.php index 696579b47..c71798916 100644 --- a/wp-content/themes/pub/wporg-learn-2024/inc/block-config.php +++ b/wp-content/themes/pub/wporg-learn-2024/inc/block-config.php @@ -392,8 +392,8 @@ function get_meta_query_values_by_key( $query, $key ) { function create_language_options( $languages ) { global $wp_query; - // If there are no languages, or the only language is en_US, don't show the filter. - if ( empty( $languages ) || ( 1 === count( $languages ) && isset( $languages['en_US'] ) ) ) { + // If there are no languages, or the only language is en_US, or a search is set, don't show the filter. + if ( empty( $languages ) || ( 1 === count( $languages ) && isset( $languages['en_US'] ) ) || $wp_query->get( 's' ) ) { return array(); } // Otherwise if there are other languages and en_US is not listed, add it to the top,