-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Ignore cached wp_theme_has_theme_json
when WP_DEBUG
is enabled
#45882
Ignore cached wp_theme_has_theme_json
when WP_DEBUG
is enabled
#45882
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
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.
LGTM in terms of just fixing the problem here, although we may want to consider a more holistic situation.
How about introducing a function like wp_theme_debug_enabled()
which returns this as a boolean, which we can use in any places where we use caching around theme-powered code? At a minimum the function could be the WP_DEBUG
check we've been starting to use, but potentially it should go further with e.g. additionally having a filter to control it so that it can be dynamically set or modified at runtime.
…theme-json-ignore-cache-wp-debug
Follows up #45543
What?
This PR updates the
wp_theme_has_theme_json
so it ignores the cache whenWP_DEBUG
is enabled.Why?
theme.json
file).gutenberg_get_global_stylesheet
to useWP_Object_Cache
#45679 and AddWP_Object_Cache
to thegutenberg_get_global_settings
method #45372).Testing Instructions
TBD