-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Check that get_current_screen is callable #25935
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
Conversation
Addison-Stavlo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the failing tests for me locally.
|
Size Change: 0 B Total Size: 1.18 MB ℹ️ View Unchanged
|
|
Do we know why this function is getting called so early before the screen is loaded? It seems like it might be papering over another bug if that function would've returned true had it been queried later in the request. |
|
Yes, why is |
|
🤷 the other option was reverting #25826. It could have to do with when that filter is being called? |
|
I.e. it seems that the filter |
|
My current guess is that the root cause would be in WordPress core, given that |
|
There is also precedence for this here: Lines 14 to 19 in 41c8464
|
|
Right, right. I think |
|
Fixed in https://core.trac.wordpress.org/ticket/51330. This PR should now be unnecessary if running |
Description
Checks that
get_current_screenis callable before calling it.This was causing PHP notice to show up on the site front end, and prevented any content from displaying:
wp-env clean allwp-env start --updateThis also appears to resolve the e2e issue described here: #25826 (comment)
How has this been tested?
With this change, I do not see an error in the above scenario.
Screenshots
the error is:
Types of changes
Checklist: