From b8f7405450ab6407037ea619f9000cd186ea2efb Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Tue, 21 Dec 2021 18:50:36 +0000 Subject: [PATCH] Login and registration: Add a filter to allow to disable the Login screen language dropdown. This change introduces the `display_login_language_dropdown` filter which allows to disable the Login screen language dropdown. Follow-up to [52058]. Props rickcurran, audrasjb, ocean90, hellofromtonya, costdev, johnbillion. Fixes #54675. git-svn-id: https://develop.svn.wordpress.org/trunk@52404 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-login.php | 111 +++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 51 deletions(-) diff --git a/src/wp-login.php b/src/wp-login.php index 0e13cc9112..31bbc4bfe3 100644 --- a/src/wp-login.php +++ b/src/wp-login.php @@ -312,58 +312,67 @@ function login_footer( $input_id = '' ) { . ?> - -
-
- - - - 'language-switcher-locales', - 'name' => 'wp_lang', - 'selected' => determine_locale(), - 'show_available_translations' => false, - 'explicit_option_en_us' => true, - 'languages' => $languages, - ); - - /** - * Filters default arguments for the Languages select input on the login screen. - * - * @since 5.9.0 - * - * @param array $args Arguments for the Languages select input on the login screen. - */ - wp_dropdown_languages( apply_filters( 'wp_login_language_switcher_args', $args ) ); - ?> - - - - - - - - - - - - - - - -
-
- - + if ( + ! $interim_login && + /** + * Filters the Languages select input activation on the login screen. + * + * @since 5.9.0 + * + * @param bool Whether to display the Languages select input on the login screen. + */ + apply_filters( 'display_login_language_dropdown', true ) + ) { + $languages = get_available_languages(); + if ( ! empty( $languages ) ) { + ?> +
+
+ + + + 'language-switcher-locales', + 'name' => 'wp_lang', + 'selected' => determine_locale(), + 'show_available_translations' => false, + 'explicit_option_en_us' => true, + 'languages' => $languages, + ); + + /** + * Filters default arguments for the Languages select input on the login screen. + * + * @since 5.9.0 + * + * @param array $args Arguments for the Languages select input on the login screen. + */ + wp_dropdown_languages( apply_filters( 'wp_login_language_switcher_args', $args ) ); + ?> + + + + + + + + + + + + + + + +
+
+ +