Skip to content

Commit

Permalink
Don't need to check for array in properties metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Jul 2, 2024
1 parent 827ad42 commit 0364d64
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -3519,22 +3519,11 @@ protected static function remove_insecure_styles( $input ) {
if ( static::is_safe_css_declaration( $declaration['name'], $declaration['value'] ) ) {
$path = static::PROPERTIES_METADATA[ $declaration['name'] ];

if ( is_array( $path ) && is_array( $path[0] ) ) {
foreach ( $path as $path_part ) {
// Check the value isn't an array before adding so as to not
// double up shorthand and longhand styles.
$value = _wp_array_get( $input, $path_part, array() );
if ( ! is_array( $value ) ) {
_wp_array_set( $output, $path_part, $value );
}
}
} else {
// Check the value isn't an array before adding so as to not
// double up shorthand and longhand styles.
$value = _wp_array_get( $input, $path, array() );
if ( ! is_array( $value ) ) {
_wp_array_set( $output, $path, $value );
}
// Check the value isn't an array before adding so as to not
// double up shorthand and longhand styles.
$value = _wp_array_get( $input, $path, array() );
if ( ! is_array( $value ) ) {
_wp_array_set( $output, $path, $value );
}
}
}
Expand Down

0 comments on commit 0364d64

Please sign in to comment.