Skip to content

Commit ca90afc

Browse files
Editor: Remove WP_DEBUG defined check in wp_tinycolor_hue_to_rgb().
The constant `WP_DEBUG` is a default constant that is set within `wp_initial_constants()` when not defined. This means the constant will always be defined, thus making the `defined( 'WP_DEBUG' )` unnecessary. Removing the `defined()` provides these benefits: * Makes the code more readable. * Tiny performance optimization. References: * WordPress/gutenberg#45979 Follow-up to [52049]. Props ocean90, spacedmonkey, mamaduka. See #57527. git-svn-id: https://develop.svn.wordpress.org/trunk@55141 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 616f0bc commit ca90afc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-includes/block-supports/duotone.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ function wp_get_duotone_filter_svg( $preset ) {
459459

460460
$svg = ob_get_clean();
461461

462-
if ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) {
462+
if ( ! SCRIPT_DEBUG ) {
463463
// Clean up the whitespace.
464464
$svg = preg_replace( "/[\r\n\t ]+/", ' ', $svg );
465465
$svg = str_replace( '> <', '><', $svg );
@@ -543,7 +543,7 @@ function wp_render_duotone_support( $block_content, $block ) {
543543

544544
// !important is needed because these styles render before global styles,
545545
// and they should be overriding the duotone filters set by global styles.
546-
$filter_style = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG
546+
$filter_style = SCRIPT_DEBUG
547547
? $selector . " {\n\tfilter: " . $filter_property . " !important;\n}\n"
548548
: $selector . '{filter:' . $filter_property . ' !important;}';
549549

0 commit comments

Comments
 (0)