← All changes
|
build/scripts/style-engine/class-wp-style-engine-css-rule-gutenberg.php
+10
-2
23.3.2
→
trunk
View file →
| @@ -76,8 +76,9 @@ | ||
| 76 | 76 | */ |
| 77 | 77 | public function add_declarations( $declarations ) { |
| 78 | 78 | $is_declarations_object = ! is_array( $declarations ); |
| 79 | 79 | $declarations_array = $is_declarations_object ? $declarations->get_declarations() : $declarations; |
| 80 | + $declaration_options = $is_declarations_object ? $declarations->get_declaration_options() : array(); | |
| 80 | 81 | |
| 81 | 82 | if ( null === $this->declarations ) { |
| 82 | 83 | if ( $is_declarations_object ) { |
| 83 | 84 | $this->declarations = $declarations; |
| @@ -82,11 +83,18 @@ | ||
| 82 | 83 | if ( $is_declarations_object ) { |
| 83 | 84 | $this->declarations = $declarations; |
| 84 | 85 | return $this; |
| 85 | 86 | } |
| 86 | - $this->declarations = new WP_Style_Engine_CSS_Declarations_Gutenberg( $declarations_array ); | |
| 87 | + $this->declarations = new WP_Style_Engine_CSS_Declarations_Gutenberg(); | |
| 87 | 88 | } |
| 88 | - $this->declarations->add_declarations( $declarations_array ); | |
| 89 | + | |
| 90 | + foreach ( $declarations_array as $property => $value ) { | |
| 91 | + $this->declarations->add_declaration( | |
| 92 | + $property, | |
| 93 | + $value, | |
| 94 | + $declaration_options[ $property ] ?? array() | |
| 95 | + ); | |
| 96 | + } | |
| 89 | 97 | |
| 90 | 98 | return $this; |
| 91 | 99 | } |
| 92 | 100 | |