WordPress.org

Make WordPress Core

Opened 4 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#54675 closed defect (bug) (fixed)

Add a filter to disable the login screen language dropdown

Reported by: audrasjb Owned by: audrasjb
Milestone: 5.9 Priority: normal
Severity: normal Version: trunk
Component: Login and Registration Keywords: has-patch needs-dev-note commit has-testing-instructions
Focuses: Cc:

Description

The login screen language dropdown was introduced in [52058].

On the Make/Core devnote, @rickcurran suggested we add a filter to allow developers to disable the language dropdown. The typical use case could be a plugin which already add the feature.

Related: #43700.
Follow-up to [52058].

Change History (12)

This ticket was mentioned in PR #2074 on WordPress/wordpress-develop by audrasjb.


4 weeks ago

  • Keywords has-patch added; needs-patch removed

#3 @audrasjb
4 weeks ago

The PR above adds the filter.
It correctly disable the language switcher, using this hook:

add_filter( 'display_login_language_dropdown', '__return_false' );

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


4 weeks ago

#5 @hellofromTonya
4 weeks ago

  • Keywords needs-dev-note added
  • Milestone changed from Awaiting Review to 5.9
  • Type changed from feature request to defect (bug)

Pulling into 5.9 and changing the type to defect. It's not technically a bug, but rather an opportunity to provide the ability to turn off the feature introduced in 5.9.

This one is part of #43700, which has a dev note. Marking needs-dev-note as the new filter will need to be added to https://make.wordpress.org/core/2021/12/20/introducing-new-language-switcher-on-the-login-screen-in-wp-5-9/.

#6 @costdev
4 weeks ago

Test Report

Env

  • WordPress: trunk (with PR 2074 applied)
  • Browser: Chrome v96.0.4664.110
  • OS: Windows 10 (WSL2)
  • Theme: Twenty Twenty-Two
  • Block Editor
  • Plugin: None activated

Steps to test

  1. Load /wp-login.php.
  2. The languages dropdown should be visible.
  3. Add the following to Twenty Twenty-Two's functions.php file and Save:
    add_filter( 'display_login_language_dropdown', '__return_false' );
    
  4. Refresh /wp-login.php.
  5. The languages dropdown should no longer be visible.

Results

  • Before adding the filter, the languages dropdown was visible.
  • After adding the filter, the languages dropdown was no longer visible.
  • All works as expected. 👍
Last edited 4 weeks ago by costdev (previous) (diff)

#7 @prbot
4 weeks ago

hellofromtonya commented on PR #2074:

@costdev did a test report https://core.trac.wordpress.org/ticket/54675#comment:6. Its as expected ✅

#8 @hellofromTonya
4 weeks ago

  • Keywords commit has-testing-instructions added

Marking PR 2074 for commit.

#9 @audrasjb
4 weeks ago

  • Owner set to audrasjb
  • Status changed from new to assigned

Self assigning for commit

#10 @audrasjb
4 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 52404:

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.

#11 @audrasjb
4 weeks ago

In 52405:

Coding Standards: Remove unwanted whitespaces after [52404].

Follow-up to [52404].

See #54675.

Note: See TracTickets for help on using tickets.