PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.0-dev3
Elementor Website Builder – more than just a page builder v3.32.0-dev3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | modules/variables/classes/style-schema.php +14 -21 4.2.23.32.0-dev3 View file →
@@ -17,14 +17,8 @@
17 17 class Style_Schema {
18 18 public function augment( array $schema ): array {
19 19 foreach ( $schema as $key => $prop_type ) {
20 20 $schema[ $key ] = $this->update( $prop_type );
21 - if ( method_exists( $prop_type, 'get_meta' ) && method_exists( $schema[ $key ], 'meta' ) ) {
22 - $meta = $schema[ $key ]->get_meta() ?? [];
23 - foreach ( $meta as $meta_key => $meta_value ) {
24 - $schema[ $key ]->meta( $meta_key, $meta_value );
25 - }
26 - }
27 21 }
28 22
29 23 if ( isset( $schema['font-family'] ) ) {
30 24 $schema['font-family'] = $this->update_font_family( $schema['font-family'] );
@@ -52,25 +46,16 @@
52 46
53 47 return $prop_type;
54 48 }
55 49
56 - private function update_font_family( $prop_type ): Union_Prop_Type {
57 -
58 - if ( $prop_type instanceof String_Prop_Type ) {
59 - return Union_Prop_Type::create_from( $prop_type )
60 - ->add_prop_type( Font_Variable_Prop_Type::make() );
61 - }
62 -
63 - if ( $prop_type instanceof Union_Prop_Type ) {
64 - $prop_type->add_prop_type( Font_Variable_Prop_Type::make() );
65 - }
66 -
67 - return $prop_type;
50 + private function update_font_family( String_Prop_Type $prop_type ): Union_Prop_Type {
51 + return Union_Prop_Type::create_from( $prop_type )
52 + ->add_prop_type( Font_Variable_Prop_Type::make() );
68 53 }
69 54
70 55 private function update_color( Color_Prop_Type $color_prop_type ): Union_Prop_Type {
71 56 return Union_Prop_Type::create_from( $color_prop_type )
72 - ->add_prop_type( Color_Variable_Prop_Type::make() );
57 + ->add_prop_type( Color_Variable_Prop_Type::make() );
73 58 }
74 59
75 60 private function update_array( Array_Prop_Type $array_prop_type ): Array_Prop_Type {
76 61 return $array_prop_type->set_item_type(
@@ -84,17 +69,25 @@
84 69 );
85 70 }
86 71
87 72 private function update_union( Union_Prop_Type $union_prop_type ): Union_Prop_Type {
73 + $new_union = Union_Prop_Type::make();
74 + $dependencies = $union_prop_type->get_dependencies();
75 + $new_union->set_dependencies( $dependencies );
76 +
88 77 foreach ( $union_prop_type->get_prop_types() as $prop_type ) {
89 78 $updated = $this->update( $prop_type );
90 79
91 80 if ( $updated instanceof Union_Prop_Type ) {
92 81 foreach ( $updated->get_prop_types() as $updated_prop_type ) {
93 - $union_prop_type->add_prop_type( $updated_prop_type );
82 + $new_union->add_prop_type( $updated_prop_type );
94 83 }
84 +
85 + continue;
95 86 }
87 +
88 + $new_union->add_prop_type( $updated );
96 89 }
97 90
98 - return $union_prop_type;
91 + return $new_union;
99 92 }
100 93 }