From b439e2a24a70be56bbd2b3845e9c3968b0310153 Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Fri, 20 May 2022 16:30:32 +0300 Subject: [PATCH] Global Styles: Add compat filter for toggling stylesheet cache --- .../wordpress-6.0/get-global-styles-and-settings.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/compat/wordpress-6.0/get-global-styles-and-settings.php b/lib/compat/wordpress-6.0/get-global-styles-and-settings.php index bb8819ec2ef257..f37a32b4bf58cd 100644 --- a/lib/compat/wordpress-6.0/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.0/get-global-styles-and-settings.php @@ -81,7 +81,9 @@ function gutenberg_get_global_stylesheet( $types = array() ) { ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) && ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) && ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) && - ! is_admin() + ! is_admin() && + /** This filter is documented in wp-includes/global-styles-and-settings.php */ + apply_filters( 'global_styles_enable_cache', true ) ); $transient_name = 'gutenberg_global_styles_' . get_stylesheet(); if ( $can_use_cached ) { @@ -147,7 +149,9 @@ function gutenberg_get_global_styles_svg_filters() { ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) && ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) && ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) && - ! is_admin() + ! is_admin() && + /** This filter is documented in wp-includes/global-styles-and-settings.php */ + apply_filters( 'global_styles_enable_cache', true ) ); if ( $can_use_cached ) { $cached = get_transient( $transient_name );