PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.0.08
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.0.08
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmFieldsController.php +276 -410 6.275.0.08 View file →
@@ -4,15 +4,8 @@
4 4 }
5 5
6 6 class FrmFieldsController {
7 7
8 - /**
9 - * This is stored statically so we can re-use this data for every field.
10 - *
11 - * @var FrmFieldSelectionData|null
12 - */
13 - private static $field_selection_data;
14 -
15 8 public static function load_field() {
16 9 FrmAppHelper::permission_check( 'frm_edit_forms' );
17 10 check_ajax_referer( 'frm_ajax', 'nonce' );
18 11
@@ -18,10 +11,9 @@
18 11
19 12 // Javascript may be included in some field settings.
20 13 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
21 14 $fields = isset( $_POST['field'] ) ? wp_unslash( $_POST['field'] ) : array();
22 -
23 - if ( ! $fields ) {
15 + if ( empty( $fields ) ) {
24 16 wp_die();
25 17 }
26 18
27 19 $_GET['page'] = 'formidable';
@@ -34,9 +26,8 @@
34 26
35 27 foreach ( $fields as $field ) {
36 28 $field = htmlspecialchars_decode( nl2br( $field ) );
37 29 $field = json_decode( $field );
38 -
39 30 if ( ! isset( $field->id ) || ! is_numeric( $field->id ) ) {
40 31 // this field may have already been loaded
41 32 continue;
42 33 }
@@ -49,10 +40,11 @@
49 40 $field->default_value = json_decode( json_encode( $field->default_value ), true );
50 41
51 42 ob_start();
52 43 self::load_single_field( $field, $values );
53 - $field_html[ absint( $field->id ) ] = ob_get_clean();
54 - }//end foreach
44 + $field_html[ absint( $field->id ) ] = ob_get_contents();
45 + ob_end_clean();
46 + }
55 47
56 48 echo json_encode( $field_html );
57 49
58 50 wp_die();
@@ -64,15 +56,14 @@
64 56 public static function create() {
65 57 FrmAppHelper::permission_check( 'frm_edit_forms' );
66 58 check_ajax_referer( 'frm_ajax', 'nonce' );
67 59
68 - $field_type = FrmAppHelper::get_post_param( 'field_type', '', 'sanitize_text_field' );
69 - $form_id = FrmAppHelper::get_post_param( 'form_id', 0, 'absint' );
70 - $field_options = FrmAppHelper::get_post_param( 'field_options', array(), 'wp_kses_post' );
60 + $field_type = FrmAppHelper::get_post_param( 'field_type', '', 'sanitize_text_field' );
61 + $form_id = FrmAppHelper::get_post_param( 'form_id', 0, 'absint' );
71 62
72 63 do_action( 'frm_before_create_field', $field_type, $form_id );
73 64
74 - $field = self::include_new_field( $field_type, $form_id, $field_options );
65 + $field = self::include_new_field( $field_type, $form_id );
75 66
76 67 // this hook will allow for multiple fields to be added at once
77 68 do_action( 'frm_after_field_created', $field, $form_id );
78 69
@@ -82,40 +73,29 @@
82 73 /**
83 74 * Set up and create a new field
84 75 *
85 76 * @param string $field_type
86 - * @param int $form_id
87 - * @param array $field_options
77 + * @param integer $form_id
88 78 *
89 - * @return array|false
79 + * @return array|bool
90 80 */
91 - public static function include_new_field( $field_type, $form_id, $field_options = array() ) {
81 + public static function include_new_field( $field_type, $form_id ) {
92 82 $field_values = FrmFieldsHelper::setup_new_vars( $field_type, $form_id );
83 + $field_values = apply_filters( 'frm_before_field_created', $field_values );
93 84
94 - if ( $field_options ) {
95 - $field_values['field_options'] = array_merge( $field_values['field_options'], $field_options );
96 - }
85 + $field_id = FrmField::create( $field_values );
97 86
98 - // When a new field is added to the form, flag it as draft and hide it from the front-end.
99 - $field_values['field_options']['draft'] = 1;
100 -
101 - /**
102 - * @param array $field_values
103 - */
104 - $field_values = apply_filters( 'frm_before_field_created', $field_values );
105 - $field_id = FrmField::create( $field_values );
106 -
107 87 if ( ! $field_id ) {
108 88 return false;
109 89 }
110 90
111 - $field = self::get_field_array_from_id( $field_id );
91 + $field = self::get_field_array_from_id( $field_id );
92 +
112 93 $values = array();
113 -
114 94 if ( FrmAppHelper::pro_is_installed() ) {
115 95 $values['post_type'] = FrmProFormsHelper::post_type( $form_id );
116 - $parent_form_id = FrmDb::get_var( 'frm_forms', array( 'id' => $form_id ), 'parent_form_id' );
117 96
97 + $parent_form_id = FrmDb::get_var( 'frm_forms', array( 'id' => $form_id ), 'parent_form_id' );
118 98 if ( $parent_form_id ) {
119 99 $field['parent_form_id'] = $parent_form_id;
120 100 }
121 101 }
@@ -128,10 +108,11 @@
128 108 public static function duplicate() {
129 109 FrmAppHelper::permission_check( 'frm_edit_forms' );
130 110 check_ajax_referer( 'frm_ajax', 'nonce' );
131 111
132 - $field_id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );
133 - $form_id = FrmAppHelper::get_post_param( 'form_id', 0, 'absint' );
112 + $field_id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );
113 + $form_id = FrmAppHelper::get_post_param( 'form_id', 0, 'absint' );
114 +
134 115 $new_field = FrmField::duplicate_single_field( $field_id, $form_id );
135 116
136 117 if ( is_array( $new_field ) && ! empty( $new_field['field_id'] ) ) {
137 118 self::load_single_field( $new_field['field_id'], $new_field['values'] );
@@ -148,8 +129,9 @@
148 129 * @return array
149 130 */
150 131 public static function get_field_array_from_id( $field_id ) {
151 132 $field = FrmField::getOne( $field_id );
133 +
152 134 return FrmFieldsHelper::setup_edit_vars( $field );
153 135 }
154 136
155 137 /**
@@ -154,13 +136,11 @@
154 136
155 137 /**
156 138 * @since 3.0
157 139 *
158 - * @param array|int|object $field_object
159 - * @param array $values
160 - * @param int $form_id
161 - *
162 - * @return void
140 + * @param int|array|object $field_object
141 + * @param array $values
142 + * @param int $form_id
163 143 */
164 144 public static function load_single_field( $field_object, $values, $form_id = 0 ) {
165 145 global $frm_vars;
166 146 $frm_vars['is_admin'] = true;
@@ -171,56 +151,50 @@
171 151 $field = $field_object;
172 152 $field_object = FrmField::getOne( $field['id'] );
173 153 }
174 154
175 - $field_obj = FrmFieldFactory::get_field_factory( $field_object );
176 - $display = self::display_field_options( array(), $field_obj );
177 - $ajax_loading = ! empty( $values['ajax_load'] );
178 - $ajax_this_field = isset( $values['count'] ) && $values['count'] > 10 && ! in_array( $field_object->type, array( 'divider', 'end_divider' ), true );
155 + $field_obj = FrmFieldFactory::get_field_factory( $field_object );
156 + $display = self::display_field_options( array(), $field_obj );
179 157
158 + $ajax_loading = isset( $values['ajax_load'] ) && $values['ajax_load'];
159 + $ajax_this_field = isset( $values['count'] ) && $values['count'] > 10 && ! in_array( $field_object->type, array( 'divider', 'end_divider' ) );
160 +
180 161 if ( $ajax_loading && $ajax_this_field ) {
181 162 $li_classes = self::get_classes_for_builder_field( array(), $display, $field_obj );
182 - include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/ajax-field-placeholder.php';
183 - return;
184 - }
163 + include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/ajax-field-placeholder.php' );
164 + } else {
165 + if ( ! isset( $field ) && is_object( $field_object ) ) {
166 + $field_object->parent_form_id = isset( $values['id'] ) ? $values['id'] : $field_object->form_id;
185 167
186 - if ( ! isset( $field ) && is_object( $field_object ) ) {
187 - $field_object->parent_form_id = $values['id'] ?? $field_object->form_id;
188 - $field = FrmFieldsHelper::setup_edit_vars( $field_object );
189 - }
168 + $field = FrmFieldsHelper::setup_edit_vars( $field_object );
169 + }
190 170
191 - /**
192 - * Filter for adding extra attributes to the field container.
193 - *
194 - * @since 6.23
195 - *
196 - * @param array $extra_field_attributes
197 - * @param array $field
198 - * @param array $display
199 - */
200 - $extra_field_attributes = apply_filters( 'frm_field_container_extra_attributes', array(), $field, $display );
171 + $li_classes = self::get_classes_for_builder_field( $field, $display, $field_obj );
172 + $li_classes .= ' ui-state-default widgets-holder-wrap';
201 173
202 - $li_classes = self::get_classes_for_builder_field( $field, $display, $field_obj );
203 - $li_classes .= ' ui-state-default widgets-holder-wrap';
204 -
205 - require FrmAppHelper::plugin_path() . '/classes/views/frm-forms/add_field.php';
174 + require( FrmAppHelper::plugin_path() . '/classes/views/frm-forms/add_field.php' );
175 + }
206 176 }
207 177
208 178 /**
209 179 * @since 3.0
210 - *
211 - * @param array $field
212 - * @param array $display
213 - * @param FrmFieldType $field_info
214 - *
215 - * @return string
216 180 */
217 181 private static function get_classes_for_builder_field( $field, $display, $field_info ) {
218 - $li_classes = $field_info->form_builder_classes( $display['type'] );
182 + $li_classes = $field_info->form_builder_classes( $display['type'] );
183 + $classes = isset( $field['classes'] ) ? $field['classes'] : '';
184 +
185 + // Exclude alignright for now since we aren't using widths.
186 + $classes = str_replace( ' frm_alignright ', ' ', $classes );
187 + $classes = trim( $classes );
188 +
189 + if ( 'frm_alignright' === $classes ) {
190 + $classes = '';
191 + }
192 +
219 193 $li_classes .= ' frm_form_field frmstart ';
220 194
221 - if ( isset( $field['classes'] ) ) {
222 - $li_classes .= trim( $field['classes'] ) . ' ';
195 + if ( $classes ) {
196 + $li_classes .= $classes . ' ';
223 197 }
224 198
225 199 $li_classes .= 'frmend';
226 200
@@ -239,11 +213,10 @@
239 213 FrmField::destroy( $field_id );
240 214 wp_die();
241 215 }
242 216
243 - /**
244 - * Field Options.
245 - */
217 + /* Field Options */
218 +
246 219 public static function import_options() {
247 220 FrmAppHelper::permission_check( 'frm_edit_forms' );
248 221 check_ajax_referer( 'frm_ajax', 'nonce' );
249 222
@@ -250,40 +223,27 @@
250 223 if ( ! is_admin() || ! current_user_can( 'frm_edit_forms' ) ) {
251 224 return;
252 225 }
253 226
254 - $field_id = FrmAppHelper::get_param( 'field_id', '', 'post', 'absint' );
255 - $field = FrmField::getOne( $field_id );
256 - $bulk_edit_types = array( 'radio', 'checkbox', 'select' );
227 + $field_id = FrmAppHelper::get_param( 'field_id', '', 'post', 'absint' );
228 + $field = FrmField::getOne( $field_id );
257 229
258 - /**
259 - * Filter to add new fields that will support import_options/Bulk Edit Options.
260 - *
261 - * @since 6.8.4
262 - *
263 - * @param array $bulk_edit_types
264 - *
265 - * @return array
266 - */
267 - $bulk_edit_types = apply_filters( 'frm_bulk_edit_field_types', $bulk_edit_types );
268 -
269 - if ( ! in_array( $field->type, $bulk_edit_types, true ) ) {
230 + if ( ! in_array( $field->type, array( 'radio', 'checkbox', 'select' ) ) ) {
270 231 return;
271 232 }
272 233
273 234 $field = FrmFieldsHelper::setup_edit_vars( $field );
235 + $opts = FrmAppHelper::get_param( 'opts', '', 'post', 'wp_kses_post' );
236 + $opts = explode( "\n", rtrim( $opts, "\n" ) );
237 + $opts = array_map( 'trim', $opts );
274 238
275 - $opts = FrmAppHelper::get_param( 'opts', '', 'post', 'wp_kses_post' );
276 - $opts = explode( "\n", rtrim( $opts, "\n" ) );
277 - $opts = array_map( 'trim', $opts );
239 + $separate = FrmAppHelper::get_param( 'separate', '', 'post', 'sanitize_text_field' );
240 + $field['separate_value'] = ( $separate === 'true' );
278 241
279 - $separate = FrmAppHelper::get_param( 'separate', '', 'post', 'sanitize_text_field' );
280 - $field['separate_value'] = $separate === 'true';
281 -
282 242 if ( $field['separate_value'] ) {
283 243 foreach ( $opts as $opt_key => $opt ) {
284 - if ( str_contains( $opt, '|' ) ) {
285 - $vals = explode( '|', $opt );
244 + if ( strpos( $opt, '|' ) !== false ) {
245 + $vals = explode( '|', $opt );
286 246 $opts[ $opt_key ] = array(
287 247 'label' => trim( $vals[0] ),
288 248 'value' => trim( $vals[1] ),
289 249 );
@@ -293,12 +253,10 @@
293 253 }
294 254 }
295 255
296 256 // Keep other options after bulk update.
297 - // phpcs:ignore Universal.Operators.StrictComparisons
298 - if ( ! empty( $field['field_options']['other'] ) ) {
257 + if ( isset( $field['field_options']['other'] ) && $field['field_options']['other'] == true ) {
299 258 $other_array = array();
300 -
301 259 foreach ( $field['options'] as $opt_key => $opt ) {
302 260 if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) {
303 261 $other_array[ $opt_key ] = $opt;
304 262 }
@@ -303,10 +261,9 @@
303 261 $other_array[ $opt_key ] = $opt;
304 262 }
305 263 unset( $opt_key, $opt );
306 264 }
307 -
308 - if ( $other_array ) {
265 + if ( ! empty( $other_array ) ) {
309 266 $opts = array_merge( $opts, $other_array );
310 267 }
311 268 }
312 269
@@ -320,10 +277,8 @@
320 277 /**
321 278 * @since 4.0
322 279 *
323 280 * @param array $atts - Includes field array, field_obj, display array, values array.
324 - *
325 - * @return void
326 281 */
327 282 public static function load_single_field_settings( $atts ) {
328 283 $field = $atts['field'];
329 284 $field_obj = $atts['field_obj'];
@@ -338,19 +293,19 @@
338 293 if ( ! isset( $field['read_only'] ) ) {
339 294 $field['read_only'] = false;
340 295 }
341 296
342 - $field_selection_data = self::maybe_define_field_selection_data();
343 - $all_field_types = $field_selection_data->all_field_types;
344 - $disabled_fields = $field_selection_data->disabled_fields;
345 - $frm_settings = FrmAppHelper::get_settings();
346 - $field_types = FrmFieldTypeOptionData::get_field_types( $field['type'] );
297 + $field_types = FrmFieldsHelper::get_field_types( $field['type'] );
298 + $pro_field_selection = FrmField::pro_field_selection();
299 + $all_field_types = array_merge( $pro_field_selection, FrmField::field_selection() );
300 + $disabled_fields = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection;
301 + $frm_settings = FrmAppHelper::get_settings();
347 302
348 303 if ( ! isset( $all_field_types[ $field['type'] ] ) ) {
349 304 // Add fallback for an add-on field type that has been deactivated.
350 305 $all_field_types[ $field['type'] ] = array(
351 306 'name' => ucfirst( $field['type'] ),
352 - 'icon' => 'frmfont frm_pencil_icon',
307 + 'icon' => 'frm_icon_font frm_pencil_icon',
353 308 );
354 309 } elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) {
355 310 // Fallback for fields added in a more basic way.
356 311 FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] );
@@ -356,9 +311,8 @@
356 311 FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] );
357 312 }
358 313
359 314 $type_name = $all_field_types[ $field['type'] ]['name'];
360 -
361 315 if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) {
362 316 $type_name = $all_field_types['divider|repeat']['name'];
363 317 }
364 318
@@ -368,77 +322,61 @@
368 322
369 323 if ( $display['clear_on_focus'] && is_array( $field['placeholder'] ) ) {
370 324 $field['placeholder'] = implode( ', ', $field['placeholder'] );
371 325 }
372 -
373 - include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/settings.php';
326 + include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/settings.php' );
374 327 }
375 328
376 329 /**
377 - * @since 6.9.1
378 - *
379 - * @return FrmFieldSelectionData
380 - */
381 - private static function maybe_define_field_selection_data() {
382 - if ( ! isset( self::$field_selection_data ) ) {
383 - self::$field_selection_data = new FrmFieldSelectionData();
384 - }
385 - return self::$field_selection_data;
386 - }
387 -
388 - /**
389 330 * Get the list of default value types that can be toggled in the builder.
390 331 *
391 332 * @since 4.0
392 - *
393 - * @param array $field
394 - * @param array $atts
395 - *
396 333 * @return array
397 334 */
398 335 private static function default_value_types( $field, $atts ) {
399 336 $types = array(
400 - 'default_value' => array(
337 + 'default_value' => array(
401 338 'class' => '',
402 - 'icon' => 'frmfont frm_text2_icon',
403 - 'title' => __( 'Default Value', 'formidable' ),
339 + 'icon' => 'frm_icon_font frm_text2_icon',
340 + 'title' => __( 'Default Value (Text)', 'formidable' ),
404 341 'data' => array(
405 342 'frmshow' => '#default-value-for-',
406 343 ),
407 344 ),
408 - 'calc' => array(
409 - 'class' => 'frm_show_upgrade frm_noallow',
410 - 'title' => __( 'Calculate Value', 'formidable' ),
411 - 'icon' => 'frmfont frm_calculator_icon',
412 - 'data' => array(
345 + 'calc' => array(
346 + 'class' => 'frm_show_upgrade frm_noallow',
347 + 'title' => __( 'Default Value (Calculation)', 'formidable' ),
348 + 'icon' => 'frm_icon_font frm_calculator_icon',
349 + 'data' => array(
413 350 'medium' => 'calculations',
414 351 'upgrade' => __( 'Calculator forms', 'formidable' ),
415 352 ),
416 - 'tooltip' => __( 'Automatically calculate the value of this field based on values from other fields.', 'formidable' ),
417 353 ),
418 354 'get_values_field' => array(
419 - 'class' => 'frm_show_upgrade frm_noallow',
420 - 'title' => __( 'Lookup', 'formidable' ),
421 - 'icon' => 'frmfont frm_search_icon',
422 - 'data' => array(
355 + 'class' => 'frm_show_upgrade frm_noallow',
356 + 'title' => __( 'Default Value (Lookup)', 'formidable' ),
357 + 'icon' => 'frm_icon_font frm_search_icon',
358 + 'data' => array(
423 359 'medium' => 'lookup',
424 360 'upgrade' => __( 'Lookup fields', 'formidable' ),
425 361 ),
426 - 'tooltip' => __( 'Dynamically retrieve the value of this field from a lookup field.', 'formidable' ),
427 362 ),
428 363 );
429 364
430 365 $types = apply_filters( 'frm_default_value_types', $types, $atts );
431 366
367 + if ( FrmAppHelper::pro_is_installed() && ! FrmAppHelper::meets_min_pro_version( '4.0' ) ) {
368 + // Prevent settings from showing in 2 spots.
369 + unset( $types['calc'], $types['get_values_field'] );
370 + }
371 +
432 372 // Set active class.
433 373 $settings = array_keys( $types );
434 374 $active = 'default_value';
435 375
436 - if ( FrmAppHelper::pro_is_connected() ) {
437 - foreach ( $settings as $type ) {
438 - if ( ! empty( $field[ $type ] ) ) {
439 - $active = $type;
440 - }
376 + foreach ( $settings as $type ) {
377 + if ( ! empty( $field[ $type ] ) ) {
378 + $active = $type;
441 379 }
442 380 }
443 381
444 382 $types[ $active ]['class'] .= ' current';
@@ -446,13 +384,8 @@
446 384
447 385 return $types;
448 386 }
449 387
450 - /**
451 - * @param string $type
452 - *
453 - * @return string
454 - */
455 388 public static function change_type( $type ) {
456 389 $type_switch = array(
457 390 'scale' => 'radio',
458 391 'star' => 'radio',
@@ -460,19 +393,15 @@
460 393 'rte' => 'textarea',
461 394 'website' => 'url',
462 395 'image' => 'url',
463 396 );
464 -
465 397 if ( isset( $type_switch[ $type ] ) ) {
466 398 $type = $type_switch[ $type ];
467 399 }
468 400
469 401 $pro_fields = FrmField::pro_field_selection();
470 - // We want to keep credit_card types as credit card types for Stripe Lite.
471 - // The credit_card key is set for backward compatibility.
472 - unset( $pro_fields['credit_card'] );
473 -
474 - if ( array_key_exists( $type, $pro_fields ) ) {
402 + $types = array_keys( $pro_fields );
403 + if ( in_array( $type, $types ) ) {
475 404 $type = 'text';
476 405 }
477 406
478 407 return $type;
@@ -478,18 +407,16 @@
478 407 return $type;
479 408 }
480 409
481 410 /**
482 - * @param array $settings
483 - * @param FrmFieldType|null $field_info
411 + * @param array $settings
412 + * @param object $field_info
484 413 *
485 414 * @return array
486 415 */
487 416 public static function display_field_options( $settings, $field_info = null ) {
488 417 if ( $field_info ) {
489 - $settings = $field_info->display_field_settings();
490 -
491 - // Field appears to be protected but there is a __get function in FrmFieldType that makes this public.
418 + $settings = $field_info->display_field_settings();
492 419 $settings['field_data'] = $field_info->field;
493 420 }
494 421
495 422 return apply_filters( 'frm_display_field_options', $settings );
@@ -499,32 +426,14 @@
499 426 * Display the format option
500 427 *
501 428 * @since 3.0
502 429 *
503 - * @param array $field Field data.
504 - * @param bool $is_hidden Whether the format option should be hidden.
505 - *
506 - * @return void
430 + * @param array $field
507 431 */
508 - public static function show_format_option( $field, $is_hidden = false ) {
509 - $attributes = array(
510 - 'class' => 'frm-has-modal',
511 - 'id' => 'frm-field-format-custom-' . $field['id'],
512 - );
513 -
514 - if ( $is_hidden ) {
515 - $attributes['class'] .= ' frm_hidden';
516 - }
517 -
518 - include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/value-format.php';
432 + public static function show_format_option( $field ) {
433 + include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/value-format.php' );
519 434 }
520 435
521 - /**
522 - * @param array $field
523 - * @param bool $echo
524 - *
525 - * @return string
526 - */
527 436 public static function input_html( $field, $echo = true ) {
528 437 $class = array();
529 438 self::add_input_classes( $field, $class );
530 439
@@ -544,26 +453,20 @@
544 453 $add_html = apply_filters( 'frm_field_extra_html', $add_html, $field );
545 454 $add_html = ' ' . implode( ' ', $add_html ) . ' ';
546 455
547 456 if ( $echo ) {
548 - echo $add_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
457 + echo $add_html; // WPCS: XSS ok.
549 458 }
550 459
551 460 return $add_html;
552 461 }
553 462
554 - /**
555 - * @param array $field
556 - * @param array $class
557 - *
558 - * @return void
559 - */
560 463 private static function add_input_classes( $field, array &$class ) {
561 - if ( ! empty( $field['input_class'] ) ) {
464 + if ( isset( $field['input_class'] ) && ! empty( $field['input_class'] ) ) {
562 465 $class[] = $field['input_class'];
563 466 }
564 467
565 - if ( $field['type'] === 'hidden' || $field['type'] === 'user_id' ) {
468 + if ( $field['type'] == 'hidden' || $field['type'] == 'user_id' ) {
566 469 return;
567 470 }
568 471
569 472 if ( isset( $field['size'] ) && $field['size'] > 0 ) {
@@ -570,14 +473,8 @@
570 473 $class[] = 'auto_width';
571 474 }
572 475 }
573 476
574 - /**
575 - * @param array $field
576 - * @param array $add_html
577 - *
578 - * @return void
579 - */
580 477 private static function add_html_size( $field, array &$add_html ) {
581 478 $size_fields = array(
582 479 'select',
583 480 'data',
@@ -586,9 +483,9 @@
586 483 'file',
587 484 'lookup',
588 485 );
589 486
590 - if ( ! isset( $field['size'] ) || $field['size'] <= 0 || in_array( $field['type'], $size_fields, true ) ) {
487 + if ( ! isset( $field['size'] ) || $field['size'] <= 0 || in_array( $field['type'], $size_fields ) ) {
591 488 return;
592 489 }
593 490
594 491 if ( FrmAppHelper::is_admin_page( 'formidable' ) ) {
@@ -605,16 +502,10 @@
605 502
606 503 self::add_html_cols( $field, $add_html );
607 504 }
608 505
609 - /**
610 - * @param array $field
611 - * @param array $add_html
612 - *
613 - * @return void
614 - */
615 506 private static function add_html_cols( $field, array &$add_html ) {
616 - if ( ! in_array( $field['type'], array( 'textarea', 'rte' ), true ) ) {
507 + if ( ! in_array( $field['type'], array( 'textarea', 'rte' ) ) ) {
617 508 return;
618 509 }
619 510
620 511 // Convert to cols for textareas.
@@ -631,18 +522,13 @@
631 522 if ( ! isset( $calc[ $unit ] ) ) {
632 523 return;
633 524 }
634 525
635 - $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ];
526 + $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ];
527 +
636 528 $add_html['cols'] = 'cols="' . absint( $size ) . '"';
637 529 }
638 530
639 - /**
640 - * @param array $field
641 - * @param array $add_html
642 - *
643 - * @return void
644 - */
645 531 private static function add_html_length( $field, array &$add_html ) {
646 532 // Check for max setting and if this field accepts maxlength.
647 533 $fields = array(
648 534 'textarea',
@@ -650,9 +536,9 @@
650 536 'hidden',
651 537 'file',
652 538 );
653 539
654 - if ( FrmField::is_option_empty( $field, 'max' ) || in_array( $field['type'], $fields, true ) ) {
540 + if ( FrmField::is_option_empty( $field, 'max' ) || in_array( $field['type'], $fields ) ) {
655 541 return;
656 542 }
657 543
658 544 if ( FrmAppHelper::is_admin_page( 'formidable' ) ) {
@@ -662,17 +548,9 @@
662 548
663 549 $add_html['maxlength'] = 'maxlength="' . esc_attr( $field['max'] ) . '"';
664 550 }
665 551
666 - /**
667 - * @param array $field
668 - * @param array $add_html
669 - * @param array $class
670 - *
671 - * @return void
672 - */
673 552 private static function add_html_placeholder( $field, array &$add_html, array &$class ) {
674 - // phpcs:ignore Universal.Operators.StrictComparisons
675 553 if ( $field['default_value'] != '' ) {
676 554 if ( is_array( $field['default_value'] ) ) {
677 555 $add_html['data-frmval'] = 'data-frmval="' . esc_attr( json_encode( $field['default_value'] ) ) . '"';
678 556 } else {
@@ -680,29 +558,43 @@
680 558 }
681 559 }
682 560
683 561 $field['placeholder'] = self::prepare_placeholder( $field );
684 -
685 - // phpcs:ignore Universal.Operators.StrictComparisons
686 562 if ( $field['placeholder'] == '' || is_array( $field['placeholder'] ) ) {
687 563 // don't include a json placeholder
688 564 return;
689 565 }
690 566
691 - self::add_placeholder_to_input( $field, $add_html );
567 + $frm_settings = FrmAppHelper::get_settings();
568 +
569 + if ( $frm_settings->use_html ) {
570 + self::add_placeholder_to_input( $field, $add_html );
571 + } else {
572 + self::add_frmval_to_input( $field, $add_html );
573 +
574 + $class[] = 'frm_toggle_default';
575 +
576 + if ( $field['value'] == $field['placeholder'] ) {
577 + $class[] = 'frm_default';
578 + }
579 + }
692 580 }
693 581
694 582 /**
695 - * Prepares field placeholder.
696 - *
697 - * @since 5.4 This doesn't call `FrmFieldsController::get_default_value_from_name()` anymore.
698 - *
699 - * @param array $field Field array.
700 - *
583 + * @param array $field
701 584 * @return string
702 585 */
703 586 private static function prepare_placeholder( $field ) {
704 - return $field['placeholder'] ?? '';
587 + $placeholder = isset( $field['placeholder'] ) ? $field['placeholder'] : '';
588 + $placeholder_is_blank = empty( $placeholder ) && '0' !== $placeholder;
589 + $is_placeholder_field = FrmFieldsHelper::is_placeholder_field_type( $field['type'] );
590 + $is_combo_field = in_array( $field['type'], array( 'address', 'credit_card' ), true );
591 +
592 + if ( $placeholder_is_blank && $is_placeholder_field && ! $is_combo_field ) {
593 + $placeholder = self::get_default_value_from_name( $field );
594 + }
595 +
596 + return $placeholder;
705 597 }
706 598
707 599 /**
708 600 * If the label position is "inside",
@@ -708,9 +600,8 @@
708 600 * If the label position is "inside",
709 601 * get the label to use as the placeholder
710 602 *
711 603 * @since 2.05
712 - * @since 5.4 Remove the logic code for "inside" label position.
713 604 *
714 605 * @param array $field
715 606 *
716 607 * @return string
@@ -715,9 +606,19 @@
715 606 *
716 607 * @return string
717 608 */
718 609 public static function get_default_value_from_name( $field ) {
719 - return '';
610 + $position = FrmField::get_option( $field, 'label' );
611 + if ( $position == 'inside' ) {
612 + $default_value = $field['name'];
613 + if ( FrmField::is_required( $field ) ) {
614 + $default_value .= ' ' . $field['required_indicator'];
615 + }
616 + } else {
617 + $default_value = '';
618 + }
619 +
620 + return $default_value;
720 621 }
721 622
722 623 /**
723 624 * Maybe add a blank placeholder option before any options
@@ -723,39 +624,22 @@
723 624 * Maybe add a blank placeholder option before any options
724 625 * in a dropdown.
725 626 *
726 627 * @since 4.04
727 - *
728 - * @param array|object $field
729 - *
730 628 * @return bool True if placeholder was added.
731 629 */
732 630 public static function add_placeholder_to_select( $field ) {
733 631 $placeholder = FrmField::get_option( $field, 'placeholder' );
734 -
735 - if ( ! $placeholder ) {
632 + if ( empty( $placeholder ) ) {
736 633 $placeholder = self::get_default_value_from_name( $field );
737 634 }
738 635
739 - $use_placeholder = $placeholder;
740 - $autocomplete = FrmField::get_option( $field, 'autocom' );
741 -
742 - if ( $autocomplete ) {
743 - $use_chosen = ! is_callable( 'FrmProAppHelper::use_chosen_js' ) || FrmProAppHelper::use_chosen_js();
744 -
745 - if ( $use_chosen ) {
746 - $use_placeholder = '';
747 - }
748 - }
749 -
750 636 if ( $placeholder !== '' ) {
751 - $placeholder_attributes = array(
752 - 'class' => 'frm-select-placeholder',
753 - 'value' => '',
754 - 'data-placeholder' => 'true',
755 - );
756 -
757 - FrmHtmlHelper::echo_dropdown_option( $use_placeholder, false, $placeholder_attributes );
637 + ?>
638 + <option value="">
639 + <?php echo esc_html( FrmField::get_option( $field, 'autocom' ) ? '' : $placeholder ); ?>
640 + </option>
641 + <?php
758 642 return true;
759 643 }
760 644
761 645 return false;
@@ -761,14 +645,12 @@
761 645 return false;
762 646 }
763 647
764 648 /**
765 - * Use HTML5 placeholder with js fallback.
649 + * Use HMTL5 placeholder with js fallback
766 650 *
767 651 * @param array $field
768 652 * @param array $add_html
769 - *
770 - * @return void
771 653 */
772 654 private static function add_placeholder_to_input( $field, &$add_html ) {
773 655 if ( FrmFieldsHelper::is_placeholder_field_type( $field['type'] ) ) {
774 656 $add_html['placeholder'] = 'placeholder="' . esc_attr( $field['placeholder'] ) . '"';
@@ -774,16 +656,9 @@
774 656 $add_html['placeholder'] = 'placeholder="' . esc_attr( $field['placeholder'] ) . '"';
775 657 }
776 658 }
777 659
778 - /**
779 - * @param array $field
780 - * @param array $add_html
781 - *
782 - * @return void
783 - */
784 660 private static function add_frmval_to_input( $field, &$add_html ) {
785 - // phpcs:ignore Universal.Operators.StrictComparisons
786 661 if ( $field['placeholder'] != '' ) {
787 662 $add_html['data-frmval'] = 'data-frmval="' . esc_attr( $field['placeholder'] ) . '"';
788 663
789 664 if ( 'select' === $field['type'] ) {
@@ -790,30 +665,21 @@
790 665 $add_html['data-frmplaceholder'] = 'data-frmplaceholder="' . esc_attr( $field['placeholder'] ) . '"';
791 666 }
792 667 }
793 668
794 - // phpcs:ignore Universal.Operators.StrictComparisons
795 669 if ( $field['default_value'] != '' ) {
796 670 $add_html['data-frmval'] = 'data-frmval="' . esc_attr( $field['default_value'] ) . '"';
797 671 }
798 672 }
799 673
800 - /**
801 - * @param array $field
802 - * @param array $add_html
803 - *
804 - * @return void
805 - */
806 674 private static function add_validation_messages( $field, array &$add_html ) {
807 - $field_validation_messages_status = self::get_validation_data_attribute_visibility_info( $field );
808 -
809 - if ( FrmField::is_required( $field ) && ! empty( $field_validation_messages_status['data-reqmsg'] ) ) {
675 + if ( FrmField::is_required( $field ) ) {
810 676 $required_message = FrmFieldsHelper::get_error_msg( $field, 'blank' );
811 677 $add_html['data-reqmsg'] = 'data-reqmsg="' . esc_attr( $required_message ) . '"';
812 678 self::maybe_add_html_required( $field, $add_html );
813 679 }
814 680
815 - if ( ! FrmField::is_option_empty( $field, 'invalid' ) && ! empty( $field_validation_messages_status['data-invmsg'] ) ) {
681 + if ( ! FrmField::is_option_empty( $field, 'invalid' ) ) {
816 682 $invalid_message = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
817 683 $add_html['data-invmsg'] = 'data-invmsg="' . esc_attr( $invalid_message ) . '"';
818 684 }
819 685
@@ -822,57 +688,20 @@
822 688 }
823 689 }
824 690
825 691 /**
826 - * Returns an array that contains field validation messages status.
827 - *
828 - * @since 6.9
829 - *
830 - * @param array|object $field
831 - *
832 - * @return array
833 - */
834 - private static function get_validation_data_attribute_visibility_info( $field ) {
835 - if ( FrmField::get_field_type( $field ) === 'hidden' ) {
836 - $field_validation_data_attributes = array(
837 - 'data-invmsg' => false,
838 - 'data-reqmsg' => false,
839 - );
840 - } else {
841 - $field_validation_data_attributes = array(
842 - 'data-invmsg' => true,
843 - 'data-reqmsg' => true,
844 - );
845 - }
846 -
847 - /**
848 - * Allows controlling which field validation messages would be included in the field html.
849 - *
850 - * @since 6.9
851 - *
852 - * @param array $field_validation_messages_status
853 - * @param array|object $field
854 - */
855 - return apply_filters( 'frm_field_validation_include_data_attributes', $field_validation_data_attributes, $field );
856 - }
857 -
858 - /**
859 692 * @since 5.0.03
860 693 *
861 694 * @param array $field
862 695 * @param array $add_html
863 - *
864 - * @return void
865 696 */
866 697 private static function maybe_add_error_html_for_js_validation( $field, array &$add_html ) {
867 698 $form = self::get_form_for_js_validation( $field );
868 -
869 699 if ( false === $form ) {
870 700 return;
871 701 }
872 702
873 703 $error_body = self::pull_custom_error_body_from_custom_html( $form, $field );
874 -
875 704 if ( false !== $error_body ) {
876 705 $error_body = urlencode( $error_body );
877 706 $add_html['data-error-html'] = 'data-error-html="' . esc_attr( $error_body ) . '"';
878 707 }
@@ -881,24 +710,20 @@
881 710 /**
882 711 * @since 5.0.03
883 712 *
884 713 * @param array $field
885 - *
886 - * @return false|stdClass false if there is no form object found with JS validation active.
714 + * @return stdClass|false false if there is no form object found with JS validation active.
887 715 */
888 716 private static function get_form_for_js_validation( $field ) {
889 717 global $frm_vars;
890 -
891 718 if ( ! empty( $frm_vars['js_validate_forms'] ) ) {
892 719 if ( isset( $frm_vars['js_validate_forms'][ $field['form_id'] ] ) ) {
893 720 return $frm_vars['js_validate_forms'][ $field['form_id'] ];
894 721 }
895 -
896 722 if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][ $field['parent_form_id'] ] ) ) {
897 723 return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ];
898 724 }
899 725 }
900 -
901 726 return false;
902 727 }
903 728
904 729 /**
@@ -904,10 +729,9 @@
904 729 /**
905 730 * @param stdClass $form
906 731 * @param array $field
907 732 * @param array $errors
908 - *
909 - * @return false|string
733 + * @return string|false
910 734 */
911 735 public static function pull_custom_error_body_from_custom_html( $form, $field, $errors = array() ) {
912 736 if ( empty( $field['custom_html'] ) ) {
913 737 return false;
@@ -914,16 +738,15 @@
914 738 }
915 739
916 740 $custom_html = $field['custom_html'];
917 741 $custom_html = apply_filters( 'frm_before_replace_shortcodes', $custom_html, $field, $errors, $form );
918 - $start = strpos( $custom_html, '[if error]' );
919 742
743 + $start = strpos( $custom_html, '[if error]' );
920 744 if ( false === $start ) {
921 745 return false;
922 746 }
923 747
924 748 $end = strpos( $custom_html, '[/if error]' );
925 -
926 749 if ( false === $end || $end < $start ) {
927 750 return false;
928 751 }
929 752
@@ -929,14 +752,16 @@
929 752
930 753 $error_body = substr( $custom_html, $start + 10, $end - $start - 10 );
931 754 $default_html = array(
932 755 '<div class="frm_error" id="frm_error_field_[key]">[error]</div>',
933 - '<div class="frm_error" role="alert" id="frm_error_field_[key]">[error]</div>',
934 756 '<div class="frm_error">[error]</div>',
935 - '<div class="frm_error" role="alert">[error]</div>',
936 757 );
937 758
938 - return in_array( $error_body, $default_html, true ) ? false : $error_body;
759 + if ( in_array( $error_body, $default_html, true ) ) {
760 + return false;
761 + }
762 +
763 + return $error_body;
939 764 }
940 765
941 766 /**
942 767 * If 'required' is added to a conditionally hidden field, the form won't
@@ -943,62 +768,33 @@
943 768 * submit in many browsers. Check to make sure the javascript to conditionally
944 769 * remove it is present if needed.
945 770 *
946 771 * @since 3.06.01
947 - *
948 772 * @param array $field
949 773 * @param array $add_html
950 - *
951 - * @return void
952 774 */
953 775 private static function maybe_add_html_required( $field, array &$add_html ) {
954 - $excluded_field_types =
955 - FrmField::is_radio( $field ) ||
956 - FrmField::is_checkbox( $field ) ||
957 - FrmField::is_field_type( $field, 'file' ) ||
958 - FrmField::is_field_type( $field, 'nps' ) ||
959 - FrmField::is_field_type( $field, 'scale' );
960 -
961 - if ( $excluded_field_types ) {
776 + if ( in_array( $field['type'], array( 'file', 'data', 'lookup' ), true ) ) {
962 777 return;
963 778 }
964 779
965 - $add_html['aria-required'] = 'aria-required="true"';
780 + $include_html = FrmAppHelper::meets_min_pro_version( '3.06.01' );
781 + if ( $include_html ) {
782 + $add_html['aria-required'] = 'aria-required="true"';
783 + }
966 784 }
967 785
968 - /**
969 - * @param array $field
970 - * @param array $add_html
971 - *
972 - * @return void
973 - */
974 786 private static function add_shortcodes_to_html( $field, array &$add_html ) {
975 787 if ( FrmField::is_option_empty( $field, 'shortcodes' ) ) {
976 788 return;
977 789 }
978 790
979 - if ( ! empty( $field['autocomplete'] ) ) {
980 - unset( $field['shortcodes']['autocomplete'] );
981 - }
982 -
983 791 foreach ( $field['shortcodes'] as $k => $v ) {
984 - if ( isset( $field['subfield_name'] ) && str_starts_with( $k, 'aria-invalid' ) ) {
985 - $subfield_name = $field['subfield_name'];
986 -
987 - if ( ! isset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] ) ) {
988 - continue;
989 - }
990 - // Change the key to the correct aria-invalid value so that $add_html is set correctly for the current subfield of a combo field.
991 - $k = 'aria-invalid';
992 - $v = $field['shortcodes'][ 'aria-invalid-' . $subfield_name ];
993 - unset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] );
994 - }
995 -
996 - if ( 'opt' === $k || ! self::should_allow_input_attribute( $k ) ) {
792 + if ( 'opt' === $k ) {
997 793 continue;
998 794 }
999 795
1000 - if ( is_numeric( $k ) && str_contains( $v, '=' ) ) {
796 + if ( is_numeric( $k ) && strpos( $v, '=' ) ) {
1001 797 $add_html[] = $v;
1002 798 } elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) {
1003 799 $add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] );
1004 800 } else {
@@ -1005,63 +801,41 @@
1005 801 $add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"';
1006 802 }
1007 803
1008 804 unset( $k, $v );
1009 - }//end foreach
1010 - }
1011 -
1012 - /**
1013 - * Disallow possibly unsafe attributees (that trigger JavaScript) when unasfe HTML is not allowed.
1014 - *
1015 - * @since 6.11.2
1016 - *
1017 - * @param string $key The option key.
1018 - *
1019 - * @return bool
1020 - */
1021 - private static function should_allow_input_attribute( $key ) {
1022 - if ( ! FrmAppHelper::should_never_allow_unfiltered_html() ) {
1023 - return true;
1024 805 }
1025 - return FrmAppHelper::input_key_is_safe( $key );
1026 806 }
1027 807
1028 808 /**
1029 - * Add pattern attribute.
809 + * Add pattern attribute
1030 810 *
1031 811 * @since 3.0
1032 812 *
1033 813 * @param array $field
1034 814 * @param array $add_html
1035 - *
1036 - * @return void
1037 815 */
1038 816 private static function add_pattern_attribute( $field, array &$add_html ) {
1039 - $format_value = FrmField::get_option( $field, 'format' );
1040 - $has_format = $format_value && ! FrmCurrencyHelper::is_currency_format( $format_value );
817 + $has_format = FrmField::is_option_true_in_array( $field, 'format' );
1041 818 $format_field = FrmField::is_field_type( $field, 'text' );
1042 819
1043 - if ( $field['type'] === 'phone' || ( $has_format && $format_field ) ) {
1044 - $format = FrmEntryValidate::phone_format( $field );
1045 - $format = substr( $format, 2, - 1 );
820 + if ( $field['type'] == 'phone' || ( $has_format && $format_field ) ) {
821 + $frm_settings = FrmAppHelper::get_settings();
1046 822
1047 - $add_html['pattern'] = 'pattern="' . esc_attr( $format ) . '"';
823 + if ( $frm_settings->use_html ) {
824 + $format = FrmEntryValidate::phone_format( $field );
825 + $format = substr( $format, 2, - 1 );
826 +
827 + $add_html['pattern'] = 'pattern="' . esc_attr( $format ) . '"';
828 + }
1048 829 }
1049 830 }
1050 831
1051 - /**
1052 - * @param mixed $opt
1053 - * @param mixed $opt_key
1054 - * @param array|object $field
1055 - *
1056 - * @return mixed
1057 - */
1058 832 public static function check_value( $opt, $opt_key, $field ) {
1059 833 if ( is_array( $opt ) ) {
1060 834 if ( FrmField::is_option_true( $field, 'separate_value' ) ) {
1061 - $opt = $opt['value'] ?? $opt['label'] ?? reset( $opt );
835 + $opt = isset( $opt['value'] ) ? $opt['value'] : ( isset( $opt['label'] ) ? $opt['label'] : reset( $opt ) );
1062 836 } else {
1063 - $opt = $opt['label'] ?? reset( $opt );
837 + $opt = isset( $opt['label'] ) ? $opt['label'] : reset( $opt );
1064 838 }
1065 839 }
1066 840
1067 841 return $opt;
@@ -1066,17 +840,109 @@
1066 840
1067 841 return $opt;
1068 842 }
1069 843
844 + public static function check_label( $opt ) {
845 + if ( is_array( $opt ) ) {
846 + $opt = ( isset( $opt['label'] ) ? $opt['label'] : reset( $opt ) );
847 + }
848 +
849 + return $opt;
850 + }
851 +
1070 852 /**
1071 - * @param mixed $opt
853 + * @deprecated 4.0
854 + */
855 + public static function update_ajax_option() {
856 + _deprecated_function( __METHOD__, '4.0' );
857 + FrmAppHelper::permission_check( 'frm_edit_forms' );
858 + check_ajax_referer( 'frm_ajax', 'nonce' );
859 +
860 + $field_id = FrmAppHelper::get_post_param( 'field', 0, 'absint' );
861 + if ( ! $field_id ) {
862 + wp_die();
863 + }
864 +
865 + $field = FrmField::getOne( $field_id );
866 +
867 + if ( isset( $_POST['separate_value'] ) ) {
868 + $new_val = FrmField::is_option_true( $field, 'separate_value' ) ? 0 : 1;
869 +
870 + $field->field_options['separate_value'] = $new_val;
871 + unset( $new_val );
872 + }
873 +
874 + FrmField::update(
875 + $field_id,
876 + array(
877 + 'field_options' => $field->field_options,
878 + 'form_id' => $field->form_id,
879 + )
880 + );
881 + wp_die();
882 + }
883 +
884 + /**
885 + * @deprecated 4.0
886 + */
887 + public static function import_choices() {
888 + _deprecated_function( __METHOD__, '4.0' );
889 + wp_die();
890 + }
891 +
892 + /**
893 + * Add Single Option or Other Option.
1072 894 *
1073 - * @return mixed
895 + * @deprecated 4.0 Moved to Pro for Other option only.
1074 896 */
1075 - public static function check_label( $opt ) {
1076 - if ( is_array( $opt ) ) {
1077 - $opt = $opt['label'] ?? reset( $opt );
897 + public static function add_option() {
898 + _deprecated_function( __METHOD__, '4.0', 'FrmProFormsController::add_other_option' );
899 + if ( is_callable( 'FrmProFormsController::add_other_option' ) ) {
900 + FrmProFormsController::add_other_option();
1078 901 }
902 + }
1079 903
1080 - return $opt;
904 + /**
905 + * @deprecated 4.0
906 + */
907 + public static function update_order() {
908 + FrmDeprecated::update_order();
909 + }
910 +
911 + /**
912 + * @deprecated 3.0
913 + * @codeCoverageIgnore
914 + */
915 + public static function edit_name( $field = 'name', $id = '' ) {
916 + FrmDeprecated::edit_name( $field, $id );
917 + }
918 +
919 + /**
920 + * @deprecated 3.0
921 + * @codeCoverageIgnore
922 + *
923 + * @param int $field_id
924 + * @param array $values
925 + * @param int $form_id
926 + *
927 + * @return array
928 + */
929 + public static function include_single_field( $field_id, $values, $form_id = 0 ) {
930 + return FrmDeprecated::include_single_field( $field_id, $values, $form_id );
931 + }
932 +
933 + /**
934 + * @deprecated 2.3
935 + * @codeCoverageIgnore
936 + */
937 + public static function edit_option() {
938 + FrmDeprecated::deprecated( __METHOD__, '2.3' );
939 + }
940 +
941 + /**
942 + * @deprecated 2.3
943 + * @codeCoverageIgnore
944 + */
945 + public static function delete_option() {
946 + FrmDeprecated::deprecated( __METHOD__, '2.3' );
1081 947 }
1082 948 }