Skip to content

Commit

Permalink
Something about yoda conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Feb 29, 2024
1 parent d217355 commit f44e145
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f44e145

Please sign in to comment.