-
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
+243
−85
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
Remove SCRIPT_DEBUG check since it is not usually part of the theme d…
…evelopers workflow
- Loading branch information
commit 6931aa838ec403200ffae622d9df6d6aea5db942
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,8 +67,8 @@ function gutenberg_get_global_stylesheet( $types = array() ) { | |
| $can_use_cached = apply_filters( | ||
| 'global_stylesheet_can_use_cache', | ||
| ( empty( $types ) ) && | ||
|
||
| ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) && | ||
| ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) | ||
| // Ignore cache when `WP_DEBUG` is enabled, so it doesn't interfere with the theme developers workflow. | ||
| ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) | ||
mmtr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ); | ||
| $cache_key = 'gutenberg_get_global_stylesheet'; | ||
mmtr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| $cache_group = 'theme_json'; | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.