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