Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

johnbillion
Copy link
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
5 checks passed
@adamziel
Copy link
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants