From 3766fb966b414616ac94fb0896afc1bb5273add8 Mon Sep 17 00:00:00 2001 From: ramonjd Date: Mon, 19 Sep 2022 15:24:37 +1000 Subject: [PATCH] To keep the script loader function up to date with the 6.1 backport Let's make sure we prioritize the incoming prettify option over the SCRIPT_DEBUG setting. --- lib/compat/wordpress-6.1/script-loader.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/compat/wordpress-6.1/script-loader.php b/lib/compat/wordpress-6.1/script-loader.php index 9c138ca88f4dbd..1d7b12c8fe8352 100644 --- a/lib/compat/wordpress-6.1/script-loader.php +++ b/lib/compat/wordpress-6.1/script-loader.php @@ -70,8 +70,9 @@ function gutenberg_enqueue_stored_styles( $options = array() ) { $compiled_core_stylesheet = ''; $style_tag_id = 'core'; foreach ( $core_styles_keys as $style_key ) { - // Adds comment to identify core styles sections in debugging. - if ( ( isset( $options['prettify'] ) && true === $options['prettify'] ) || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) { + // Adds comment if code is prettified to identify core styles sections in debugging. + $should_prettify = isset( $options['prettify'] ) ? true === $options['prettify'] : defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG; + if ( $should_prettify ) { $compiled_core_stylesheet .= "/**\n * Core styles: $style_key\n */\n"; } // Chains core store ids to signify what the styles contain.