PluginProbe
Gutenberg / 22.7.0
Gutenberg v22.7.0
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
← 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 '';