PluginProbe
Elementor Website Builder – more than just a page builder / 3.1.3
Elementor Website Builder – more than just a page builder v3.1.3
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 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 All 453 releases
← All changes | includes/controls/select2.php +0 -46 3.1.23.1.3 View file →
@@ -88,51 +88,5 @@
88 88 <div class="elementor-control-field-description">{{{ data.description }}}</div>
89 89 <# } #>
90 90 <?php
91 91 }
92 -
93 -
94 - /**
95 - * @param string|array $value
96 - * @param array $config
97 - *
98 - * @return string|array
99 - */
100 - public function before_save( $value, array $config ) {
101 - return $this->validate_value( $value, $config );
102 - }
103 -
104 - /**
105 - * Validate the value is listed in the control options config.
106 - *
107 - * Avoid change settings like `html_tag` & `title_size` to a `script` tag.
108 - *
109 - * @param string|array $value
110 - * @param array $config
111 - *
112 - * @return string|array
113 - */
114 - private function validate_value( $value, array $config ) {
115 - // Handle multiple select.
116 - if ( ! empty( $config['multiple'] ) ) {
117 - $validated_value = [];
118 -
119 - foreach ( $value as $index => $item ) {
120 - if ( isset( $config['options'][ $item ] ) ) {
121 - $validated_value[ $index ] = $item;
122 - }
123 - }
124 -
125 - $value = $validated_value;
126 - $is_valid = true;
127 - } else {
128 - $is_valid = isset( $config['options'][ $value ] );
129 - }
130 -
131 - // If it's not one of the control options. reset it to default.
132 - if ( ! $is_valid ) {
133 - $value = $config['default'];
134 - }
135 -
136 - return $value;
137 - }
138 92 }