PluginProbe
Elementor Website Builder – more than just a page builder / 3.33.0-beta1
Elementor Website Builder – more than just a page builder v3.33.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 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 All 457 releases
← All changes | modules/atomic-widgets/props-resolver/transformers/styles/transition-transformer.php +3 -26 4.2.0-dev2 → 3.33.0-beta1 View file →
@@ -11,37 +11,20 @@
11 11
12 12 class Transition_Transformer extends Transformer_Base {
13 13 const EMPTY_STRING = '';
14 14
15 - private function get_allowed_properties(): array {
16 - $core_properties = [ 'all' ];
17 -
18 - return apply_filters(
19 - 'elementor/atomic-widgets/styles/transitions/allowed-properties',
20 - $core_properties
21 - );
22 - }
23 -
24 15 public function transform( $transitions, Props_Resolver_Context $context ) {
25 16 if ( ! is_array( $transitions ) ) {
26 17 return self::EMPTY_STRING;
27 18 }
28 19
29 - $allowed_properties = $this->get_allowed_properties();
30 -
31 - $transition_strings = array_map(
32 - function( $transition ) use ( $allowed_properties ) {
33 - return $this->map_to_transition_string( $transition, $allowed_properties );
34 - },
35 - $transitions
36 - );
37 -
20 + $transition_strings = array_map( [ $this, 'map_to_transition_string' ], $transitions );
38 21 $valid_transitions = array_filter( $transition_strings );
39 22
40 23 return implode( ', ', $valid_transitions );
41 24 }
42 25
43 - private function map_to_transition_string( $transition, array $allowed_properties ): string {
26 + private function map_to_transition_string( $transition ): string {
44 27 if ( empty( $transition['selection'] ) || empty( $transition['size'] ) ) {
45 28 return self::EMPTY_STRING;
46 29 }
47 30
@@ -51,13 +34,7 @@
51 34 if ( empty( $selection['value'] ) ) {
52 35 return self::EMPTY_STRING;
53 36 }
54 37
55 - $property = $selection['value'];
56 -
57 - if ( ! in_array( $property, $allowed_properties, true ) ) {
58 - return self::EMPTY_STRING;
59 - }
60 -
61 - return trim( "{$property} {$size}" );
38 + return trim( "{$selection['value']} {$size}" );
62 39 }
63 40 }