Skip to content
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 Nov 9, 2022
0a23b43
Add remaining hooks
mmtr Nov 9, 2022
714819b
Simplify test setup
mmtr Nov 9, 2022
4f36f72
Rename cache key and functions
mmtr Nov 9, 2022
0f80d71
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr Nov 16, 2022
a845e85
Add filter to shortcircuit the cache
mmtr Nov 16, 2022
6014519
Clean cache within `wp_theme_clean_theme_json_cached_data`
mmtr Nov 16, 2022
5acfd40
Fix test
mmtr Nov 16, 2022
4eaeb71
Add missing params in docstring
mmtr Nov 16, 2022
e8a32cb
Create separate function to clean the cache
mmtr Nov 16, 2022
6931aa8
Remove SCRIPT_DEBUG check since it is not usually part of the theme d…
mmtr Nov 16, 2022
a2b9d6f
Clear cache from WP_Theme_JSON_Resolver separately
mmtr Nov 16, 2022
2acbafd
Rename filter
mmtr Nov 16, 2022
30361b5
Fix linting issues
mmtr Nov 16, 2022
b38b5b8
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr Nov 17, 2022
0a371d4
Use WP version in since annotation
mmtr Nov 17, 2022
18cd94f
Check parent theme (props @felixarntz)
mmtr Nov 17, 2022
8e2ffb8
Invalidate WP_Theme_JSON_Resolver_Gutenberg cache after toggling a pl…
mmtr Nov 17, 2022
18f1443
Invalidate WP_Theme_JSON_Resolver_Gutenberg cache after an upgrade
mmtr Nov 17, 2022
4f1a1b8
Remove @since 6.2.0 annotations as we don't know which WP version wil…
mmtr Nov 17, 2022
795045a
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr Nov 17, 2022
c9df6b4
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr Nov 17, 2022
88c1e33
Update phpunit/wp-get-global-stylesheet-test.php
mmtr Nov 17, 2022
9dcdde7
Add missing params to actions
mmtr Nov 18, 2022
9321aca
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr Nov 21, 2022
8f642a4
Merge remote-tracking branch 'origin/trunk' into update/global-styles…
mmtr Nov 22, 2022
2b16326
Remove filter
mmtr Nov 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove SCRIPT_DEBUG check since it is not usually part of the theme d…
…evelopers workflow
  • Loading branch information
mmtr committed Nov 16, 2022
commit 6931aa838ec403200ffae622d9df6d6aea5db942
4 changes: 2 additions & 2 deletions lib/compat/wordpress-6.2/get-global-styles-and-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ function gutenberg_get_global_stylesheet( $types = array() ) {
$can_use_cached = apply_filters(
'global_stylesheet_can_use_cache',
( empty( $types ) ) &&
Copy link
Member

@oandregal oandregal Nov 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea for a potential follow-up: this code currently only caches the whole stylesheet, meaning the one that is enqueued in the front-end (see). I wonder whether it makes sense to cache the others for the editor as well (see) and what effect would it have in the loading times of the editor.

( ! 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 )
);
$cache_key = 'gutenberg_get_global_stylesheet';
$cache_group = 'theme_json';
Expand Down