diff --git a/src/wp-includes/global-styles-and-settings.php b/src/wp-includes/global-styles-and-settings.php index efc2edcaaa354..49fccc7a3e37a 100644 --- a/src/wp-includes/global-styles-and-settings.php +++ b/src/wp-includes/global-styles-and-settings.php @@ -93,7 +93,15 @@ function wp_get_global_stylesheet( $types = array() ) { ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) && ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) && ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) && - ! is_admin() + ! is_admin() && + /** + * Whether to enable the global styles stylesheet cache. + * + * @since 6.0.0 + * + * @param bool $enable True to enable transient cache, false otherwise. + */ + apply_filters( 'global_styles_enable_cache', true ) ); $transient_name = 'global_styles_' . get_stylesheet(); if ( $can_use_cached ) { @@ -165,7 +173,9 @@ function wp_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 ) ); $transient_name = 'global_styles_svg_filters_' . get_stylesheet(); if ( $can_use_cached ) {