PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.3
Elementor Website Builder – more than just a page builder v3.34.3
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/interactions/parser.php +5 -24 4.2.13.34.3 View file →
@@ -49,37 +49,18 @@
49 49 return [];
50 50 }
51 51
52 52 foreach ( $interactions['items'] as &$interaction ) {
53 - if ( ! isset( $interaction['$$type'] ) || 'interaction-item' !== $interaction['$$type'] ) {
54 - continue;
55 - }
56 -
57 - $existing_id = null;
58 - if ( isset( $interaction['value']['interaction_id']['value'] ) ) {
59 - $existing_id = $interaction['value']['interaction_id']['value'];
60 - }
61 -
62 - if ( $existing_id && $this->is_temp_id( $existing_id ) ) {
63 - $interaction['value']['interaction_id'] = [
64 - '$$type' => 'string',
65 - 'value' => $this->get_next_interaction_id( $element_id ),
66 - ];
67 - } elseif ( $existing_id ) {
68 - $this->ids_lookup[] = $existing_id;
53 + if ( array_key_exists( 'interaction_id', $interaction ) ) {
54 + $this->ids_lookup[] = $interaction['interaction_id'];
69 55 } else {
70 - $interaction['value']['interaction_id'] = [
71 - '$$type' => 'string',
72 - 'value' => $this->get_next_interaction_id( $element_id ),
73 - ];
56 + $interaction = array_merge( [
57 + 'interaction_id' => $this->get_next_interaction_id( $element_id ),
58 + ], $interaction );
74 59 }
75 60 }
76 61
77 62 return wp_json_encode( $interactions );
78 - }
79 -
80 - private function is_temp_id( $id ) {
81 - return is_string( $id ) && strpos( $id, 'temp-' ) === 0;
82 63 }
83 64
84 65 private function decode_interactions( $interactions ) {
85 66 if ( is_array( $interactions ) ) {