PluginProbe
Elementor Website Builder – more than just a page builder / 3.3.0
Elementor Website Builder – more than just a page builder v3.3.0
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 | includes/controls/repeater.php +6 -29 4.2.23.3.0 View file →
@@ -16,9 +16,9 @@
16 16 * or external libraries.
17 17 *
18 18 * @since 1.0.0
19 19 */
20 -class Control_Repeater extends Base_Data_Control implements Has_Validation {
20 +class Control_Repeater extends Base_Data_Control {
21 21
22 22 /**
23 23 * Get repeater control type.
24 24 *
@@ -64,10 +64,8 @@
64 64 'fields' => [],
65 65 'title_field' => '',
66 66 'prevent_empty' => true,
67 67 'is_repeater' => true,
68 - 'max_items' => 0,
69 - 'min_items' => 0,
70 68 'item_actions' => [
71 69 'add' => true,
72 70 'duplicate' => true,
73 71 'remove' => true,
@@ -83,10 +81,10 @@
83 81 *
84 82 * @since 1.0.0
85 83 * @access public
86 84 *
87 - * @param array $control Control.
88 - * @param array $settings Controls_Stack settings.
85 + * @param array $control Control
86 + * @param array $settings Controls_Stack settings
89 87 *
90 88 * @return mixed Control values.
91 89 */
92 90 public function get_value( $control, $settings ) {
@@ -166,36 +164,15 @@
166 164 ?>
167 165 <label>
168 166 <span class="elementor-control-title">{{{ data.label }}}</span>
169 167 </label>
170 - <div class="elementor-repeater-fields-wrapper" role="list"></div>
168 + <div class="elementor-repeater-fields-wrapper"></div>
171 169 <# if ( itemActions.add ) { #>
172 170 <div class="elementor-button-wrapper">
173 - <button class="elementor-button elementor-repeater-add" type="button">
174 - <i class="eicon-plus" aria-hidden="true"></i>
175 - <# if ( data.button_text ) { #>
176 - {{{ data.button_text }}}
177 - <# } else { #>
178 - <?php echo esc_html__( 'Add Item', 'elementor' ); ?>
179 - <# } #>
171 + <button class="elementor-button elementor-button-default elementor-repeater-add" type="button">
172 + <i class="eicon-plus" aria-hidden="true"></i><?php echo __( 'Add Item', 'elementor' ); ?>
180 173 </button>
181 174 </div>
182 175 <# } #>
183 176 <?php
184 - }
185 -
186 - public function validate( array $control_data ): bool {
187 - if ( isset( $control_data['min_items'] ) ) {
188 -
189 - if (
190 - ! isset( $control_data['default'] ) ||
191 - count( $control_data['default'] ) < $control_data['min_items']
192 - ) {
193 - throw new \Exception(
194 - esc_html__( 'In a Repeater control, if you specify a minimum number of items, you must also specify a default value that contains at least that number of items.', 'elementor' )
195 - );
196 - }
197 - }
198 -
199 - return true;
200 177 }
201 178 }