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.

Built from https://develop.svn.wordpress.org/trunk@52404


git-svn-id: http://core.svn.wordpress.org/trunk@51996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2021-12-21 18:52:03 +00:00
parent e6b9b96130
commit d0b3567730
2 changed files with 61 additions and 52 deletions

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-beta3-52403';
$wp_version = '5.9-beta3-52404';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -312,11 +312,21 @@ function login_footer( $input_id = '' ) {
</div><?php // End of <div id="login">. ?>
<?php
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 ) && ! $interim_login ) {
if ( ! empty( $languages ) ) {
?>
<div class="language-switcher">
<form id="language-switcher" action="" method="get">
@ -361,9 +371,8 @@ function login_footer( $input_id = '' ) {
</form>
</div>
<?php } ?>
<?php } ?>
<?php
if ( ! empty( $input_id ) ) {