Skip to content

Commit

Permalink
2024 Theme: Remove language filter for searches
Browse files Browse the repository at this point in the history
Searches are language specific so a language filter is mostly unnecessary.

Temporary fix for #2577
  • Loading branch information
adamwoodnz committed Jul 25, 2024
1 parent a9507e7 commit b4a082e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wp-content/themes/pub/wporg-learn-2024/inc/block-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b4a082e

Please sign in to comment.