| @@ -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. |
| @@ -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 | } |