PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.0
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.0
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 +24 -22 6.5.26.0 View file →
@@ -79,14 +79,11 @@
79 79 * @return array|bool
80 80 */
81 81 public static function include_new_field( $field_type, $form_id ) {
82 82 $field_values = FrmFieldsHelper::setup_new_vars( $field_type, $form_id );
83 + $field_values = apply_filters( 'frm_before_field_created', $field_values );
83 84
84 - /**
85 - * @param array $field_values
86 - */
87 - $field_values = apply_filters( 'frm_before_field_created', $field_values );
88 - $field_id = FrmField::create( $field_values );
85 + $field_id = FrmField::create( $field_values );
89 86
90 87 if ( ! $field_id ) {
91 88 return false;
92 89 }
@@ -315,10 +312,9 @@
315 312
316 313 if ( $display['clear_on_focus'] && is_array( $field['placeholder'] ) ) {
317 314 $field['placeholder'] = implode( ', ', $field['placeholder'] );
318 315 }
319 -
320 - 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' );
321 317 }
322 318
323 319 /**
324 320 * Get the list of default value types that can be toggled in the builder.
@@ -392,13 +388,10 @@
392 388 $type = $type_switch[ $type ];
393 389 }
394 390
395 391 $pro_fields = FrmField::pro_field_selection();
396 - // We want to keep credit_card types as credit card types for Stripe Lite.
397 - // The credit_card key is set for backward compatibility.
398 - unset( $pro_fields['credit_card'] );
399 -
400 - if ( array_key_exists( $type, $pro_fields ) ) {
392 + $types = array_keys( $pro_fields );
393 + if ( in_array( $type, $types ) ) {
401 394 $type = 'text';
402 395 }
403 396
404 397 return $type;
@@ -500,9 +493,9 @@
500 493 self::add_html_cols( $field, $add_html );
501 494 }
502 495
503 496 private static function add_html_cols( $field, array &$add_html ) {
504 - if ( ! in_array( $field['type'], array( 'textarea', 'rte' ), true ) ) {
497 + if ( ! in_array( $field['type'], array( 'textarea', 'rte' ) ) ) {
505 498 return;
506 499 }
507 500
508 501 // Convert to cols for textareas.
@@ -619,9 +612,9 @@
619 612 }
620 613
621 614 if ( $placeholder !== '' ) {
622 615 ?>
623 - <option class="frm-select-placeholder" value="">
616 + <option value="">
624 617 <?php echo esc_html( FrmField::get_option( $field, 'autocom' ) ? '' : $placeholder ); ?>
625 618 </option>
626 619 <?php
627 620 return true;
@@ -759,16 +752,9 @@
759 752 * @param array $field
760 753 * @param array $add_html
761 754 */
762 755 private static function maybe_add_html_required( $field, array &$add_html ) {
763 - $excluded_field_types =
764 - FrmField::is_radio( $field ) ||
765 - FrmField::is_checkbox( $field ) ||
766 - FrmField::is_field_type( $field, 'file' ) ||
767 - FrmField::is_field_type( $field, 'nps' ) ||
768 - FrmField::is_field_type( $field, 'scale' );
769 -
770 - if ( $excluded_field_types ) {
756 + if ( in_array( $field['type'], array( 'file', 'data', 'lookup' ), true ) ) {
771 757 return;
772 758 }
773 759
774 760 $include_html = FrmAppHelper::meets_min_pro_version( '3.06.01' );
@@ -922,6 +908,22 @@
922 908 * @return array
923 909 */
924 910 public static function include_single_field( $field_id, $values, $form_id = 0 ) {
925 911 return FrmDeprecated::include_single_field( $field_id, $values, $form_id );
912 + }
913 +
914 + /**
915 + * @deprecated 2.3
916 + * @codeCoverageIgnore
917 + */
918 + public static function edit_option() {
919 + FrmDeprecated::deprecated( __METHOD__, '2.3' );
920 + }
921 +
922 + /**
923 + * @deprecated 2.3
924 + * @codeCoverageIgnore
925 + */
926 + public static function delete_option() {
927 + FrmDeprecated::deprecated( __METHOD__, '2.3' );
926 928 }
927 929 }