-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Global Styles: Update gutenberg_get_global_stylesheet to use WP_Object_Cache
#45679
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
fad27ea
Global Styles: Update `gutenberg_get_global_stylesheet` to use `WP_Ob…
mmtr 0a23b43
Add remaining hooks
mmtr 714819b
Simplify test setup
mmtr 4f36f72
Rename cache key and functions
mmtr 0f80d71
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr a845e85
Add filter to shortcircuit the cache
mmtr 6014519
Clean cache within `wp_theme_clean_theme_json_cached_data`
mmtr 5acfd40
Fix test
mmtr 4eaeb71
Add missing params in docstring
mmtr e8a32cb
Create separate function to clean the cache
mmtr 6931aa8
Remove SCRIPT_DEBUG check since it is not usually part of the theme d…
mmtr a2b9d6f
Clear cache from WP_Theme_JSON_Resolver separately
mmtr 2acbafd
Rename filter
mmtr 30361b5
Fix linting issues
mmtr b38b5b8
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr 0a371d4
Use WP version in since annotation
mmtr 18cd94f
Check parent theme (props @felixarntz)
mmtr 8e2ffb8
Invalidate WP_Theme_JSON_Resolver_Gutenberg cache after toggling a pl…
mmtr 18f1443
Invalidate WP_Theme_JSON_Resolver_Gutenberg cache after an upgrade
mmtr 4f1a1b8
Remove @since 6.2.0 annotations as we don't know which WP version wil…
mmtr 795045a
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr c9df6b4
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr 88c1e33
Update phpunit/wp-get-global-stylesheet-test.php
mmtr 9dcdde7
Add missing params to actions
mmtr 9321aca
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr 8f642a4
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr 2b16326
Remove filter
mmtr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Invalidate WP_Theme_JSON_Resolver_Gutenberg cache after an upgrade
- Loading branch information
commit 18f144346bc4bd2b2e4a3783a6a394a6d46d9fde
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Let stop adding static methods to this class. They are not in part of the WordPress coding standards and are harder to test.
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.
I've done a quick search for this pattern and there are multiple cases where this pattern is used:
I won't list them all, but these should serve to highlight that there are different sensibilities around this. Given this code is architected this way, and it is a very common pattern, I don't think we should do it differently.