From f44e14579f7679fb5a9e99a2b49e44e4a1cfcdc0 Mon Sep 17 00:00:00 2001 From: ramon Date: Thu, 29 Feb 2024 11:14:03 +1100 Subject: [PATCH] Something about yoda conditions --- lib/class-wp-theme-json-gutenberg.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index 9a5e26fc9c1c2e..165ff997b3180a 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -2133,12 +2133,9 @@ protected static function compute_style_properties( $styles, $settings = array() } // Processes background styles. - if ( $value_path[0] === 'background' && isset( $styles['background'] ) ) { - $background_styles = gutenberg_get_background_support_styles( - $styles['background'], - ); - - $value = $background_styles['declarations'][ $css_property ] ?? $value; + if ( 'background' === $value_path[0] && isset( $styles['background'] ) ) { + $background_styles = gutenberg_get_background_support_styles( $styles['background'] ); + $value = $background_styles['declarations'][ $css_property ] ?? $value; } // Skip if empty and not "0" or value represents array of longhand values.