Skip to content

Fix the login message so it doesn't override another - #1044

Merged
adamziel merged 1 commit into
WordPress:trunkfrom
johnbillion:login-message
Feb 24, 2024
Merged

Fix the login message so it doesn't override another#1044
adamziel merged 1 commit into
WordPress:trunkfrom
johnbillion:login-message

Conversation

@johnbillion

Copy link
Copy Markdown
Member

What is this PR doing?

It fixes an issue in the 0-playground.php mu-plugin which causes it to overwrite other messages on the wp-login.php screen with its own, rather than appending to them.

What problem is it solving?

If a plugin uses the login_message filter to add a message to the wp-login.php screen, 0-playground.php can overwrite it.

How is the problem addressed?

It's addressed by using add_filter() instead of the incorrect add_action(), and by appending its message instead of overwriting it.

Testing Instructions

  1. Visit the Playground with the ?plugin=user-switching query variable present
  2. Click the "Switch Off" link in the user profile menu in the admin toolbar
  3. Visit /wp-login.php using the URL input field
  4. Confirm that a "Switch back" message and link is shown by the User Switching plugin instead if being overwritten by the playground

Screenshots

Before

2024-02-21-00-43-06

After

2024-02-21-00-42-56

@adamziel
adamziel merged commit d146905 into WordPress:trunk Feb 24, 2024
@adamziel

Copy link
Copy Markdown
Collaborator

This is awesome @johnbillion, thank you so much!

@johnbillion
johnbillion deleted the login-message branch February 24, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants