From eb756765b315eef7b2d46168ffc4ba5ad98febe8 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Wed, 24 Mar 2021 10:52:55 +0200 Subject: [PATCH] Revert "Add check to avoid PHP warnings (#30127)" This reverts commit 816535d7645762adbecb856ff7f800b70e225a53. --- lib/class-wp-theme-json.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/class-wp-theme-json.php b/lib/class-wp-theme-json.php index 6728fb72d02679..35da7df75b79a4 100644 --- a/lib/class-wp-theme-json.php +++ b/lib/class-wp-theme-json.php @@ -649,7 +649,7 @@ private static function compute_style_properties( $declarations, $styles ) { foreach ( $properties as $prop ) { $value = self::get_property_value( $styles, $prop['value'] ); if ( ! empty( $value ) ) { - $declarations[] = array( + $declarations[] = array( 'name' => $prop['name'], 'value' => $value, ); @@ -678,9 +678,6 @@ private static function compute_preset_classes( $settings, $selector ) { $stylesheet = ''; foreach ( self::PRESETS_METADATA as $preset ) { $values = _wp_array_get( $settings, $preset['path'], array() ); - if ( empty( $values ) ) { - continue; - } foreach ( $values as $value ) { foreach ( $preset['classes'] as $class ) { $stylesheet .= self::to_ruleset( @@ -719,9 +716,6 @@ private static function compute_preset_classes( $settings, $selector ) { private static function compute_preset_vars( $declarations, $settings ) { foreach ( self::PRESETS_METADATA as $preset ) { $values = _wp_array_get( $settings, $preset['path'], array() ); - if ( empty( $values ) ) { - continue; - } foreach ( $values as $value ) { $declarations[] = array( 'name' => '--wp--preset--' . $preset['css_var_infix'] . '--' . $value['slug'],