← All changes
|
build/scripts/style-engine/style-engine-gutenberg.php
+4
-10
23.6.2
→
22.7.0
View file →
| @@ -84,10 +84,9 @@ | ||
| 84 | 84 | * |
| 85 | 85 | * @type array ...$0 { |
| 86 | 86 | * @type string $rules_group A parent CSS selector in the case of nested CSS, or a CSS nested @rule, such as `@media (min-width: 80rem)` or `@layer module`. |
| 87 | 87 | * @type string $selector A CSS selector. |
| 88 | - * @type string[]|WP_Style_Engine_CSS_Declarations_Gutenberg $declarations An associative array of CSS definitions, e.g., array( "$property" => "$value", "$property" => "$value" ), | |
| 89 | - * or a WP_Style_Engine_CSS_Declarations_Gutenberg object. | |
| 88 | + * @type string[] $declarations An associative array of CSS definitions, e.g., array( "$property" => "$value", "$property" => "$value" ). | |
| 90 | 89 | * } |
| 91 | 90 | * } |
| 92 | 91 | * @param array $options { |
| 93 | 92 | * Optional. An array of options. Default empty array. |
| @@ -113,23 +112,18 @@ | ||
| 113 | 112 | ); |
| 114 | 113 | |
| 115 | 114 | $css_rule_objects = array(); |
| 116 | 115 | foreach ( $css_rules as $css_rule ) { |
| 117 | - $declarations = $css_rule['declarations'] ?? null; | |
| 118 | - if ( | |
| 119 | - empty( $css_rule['selector'] ) || | |
| 120 | - empty( $declarations ) || | |
| 121 | - ( ! is_array( $declarations ) && ! $declarations instanceof WP_Style_Engine_CSS_Declarations_Gutenberg ) | |
| 122 | - ) { | |
| 116 | + if ( empty( $css_rule['selector'] ) || empty( $css_rule['declarations'] ) || ! is_array( $css_rule['declarations'] ) ) { | |
| 123 | 117 | continue; |
| 124 | 118 | } |
| 125 | 119 | |
| 126 | 120 | $rules_group = $css_rule['rules_group'] ?? null; |
| 127 | 121 | if ( ! empty( $options['context'] ) ) { |
| 128 | - WP_Style_Engine_Gutenberg::store_css_rule( $options['context'], $css_rule['selector'], $declarations, $rules_group ); | |
| 122 | + WP_Style_Engine_Gutenberg::store_css_rule( $options['context'], $css_rule['selector'], $css_rule['declarations'], $rules_group ); | |
| 129 | 123 | } |
| 130 | 124 | |
| 131 | - $css_rule_objects[] = new WP_Style_Engine_CSS_Rule_Gutenberg( $css_rule['selector'], $declarations, $rules_group ); | |
| 125 | + $css_rule_objects[] = new WP_Style_Engine_CSS_Rule_Gutenberg( $css_rule['selector'], $css_rule['declarations'], $rules_group ); | |
| 132 | 126 | } |
| 133 | 127 | |
| 134 | 128 | if ( empty( $css_rule_objects ) ) { |
| 135 | 129 | return ''; |