Skip to content

Commit

Permalink
Skips if individual style property not defined (#43122)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonya Mork authored and andrewserong committed Aug 15, 2022
1 parent a2eed55 commit f1b43e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/style-engine/class-wp-style-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ protected static function get_css_declarations( $style_value, $style_definition,
// If the input contains an array, assume box model-like properties
// for styles such as margins and padding.
if ( is_array( $style_value ) ) {
// Bail out early if the `'individual'` property is not defined.
if ( ! isset( $style_property_keys['individual'] ) ) {
return $css_declarations;
}

foreach ( $style_value as $key => $value ) {
if ( is_string( $value ) && strpos( $value, 'var:' ) !== false && ! $should_skip_css_vars && ! empty( $style_definition['css_vars'] ) ) {
$value = static::get_css_var_value( $value, $style_definition['css_vars'] );
Expand Down

0 comments on commit f1b43e1

Please sign in to comment.