@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $intent_is_processing = 'processing' === $intent->status; |
| 58 | 58 | if ( $intent_is_processing ) { |
| 59 | 59 | // Append an additional processing message to the end of the success message. |
| 60 | - $filter = function ( $message ) { |
|
| 60 | + $filter = function( $message ) { |
|
| 61 | 61 | $stripe_settings = FrmStrpLiteAppHelper::get_settings(); |
| 62 | 62 | $message .= '<p>' . esc_html( $stripe_settings->settings->processing_message ) . '</p>'; |
| 63 | 63 | return $message; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $atts['form'] = FrmForm::getOne( $atts['entry']->form_id ); |
| 162 | 162 | $atts['entry_id'] = $atts['entry']->id; |
| 163 | 163 | $opt = 'success_action'; |
| 164 | - $atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 164 | + $atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 165 | 165 | |
| 166 | 166 | $actions = FrmFormsController::get_met_on_submit_actions( $atts, 'create' ); |
| 167 | 167 | if ( $actions ) { |
@@ -246,10 +246,10 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | public static function get_payment_intents( $name ) { |
| 248 | 248 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 249 | - if ( ! isset( $_POST[ $name ] ) ) { |
|
| 249 | + if ( ! isset( $_POST[$name] ) ) { |
|
| 250 | 250 | return array(); |
| 251 | 251 | } |
| 252 | - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 252 | + $intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 253 | 253 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); |
| 254 | 254 | return $intents; |
| 255 | 255 | } |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | self::format_form_data( $form ); |
| 277 | 277 | |
| 278 | 278 | $form_id = absint( $form['form_id'] ); |
| 279 | - $intents = $form[ 'frmintent' . $form_id ] ?? array(); |
|
| 279 | + $intents = $form['frmintent' . $form_id] ?? array(); |
|
| 280 | 280 | |
| 281 | 281 | if ( empty( $intents ) ) { |
| 282 | 282 | wp_die(); |
@@ -286,8 +286,8 @@ discard block |
||
| 286 | 286 | $intents = array( $intents ); |
| 287 | 287 | } else { |
| 288 | 288 | foreach ( $intents as $k => $intent ) { |
| 289 | - if ( is_array( $intent ) && isset( $intent[ $k ] ) ) { |
|
| 290 | - $intents[ $k ] = $intent[ $k ]; |
|
| 289 | + if ( is_array( $intent ) && isset( $intent[$k] ) ) { |
|
| 290 | + $intents[$k] = $intent[$k]; |
|
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | } |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | if ( $saved->metadata->action != $action->ID ) { |
| 345 | 345 | continue; |
| 346 | 346 | } |
| 347 | - $intents[ $k ] = array( |
|
| 347 | + $intents[$k] = array( |
|
| 348 | 348 | 'id' => $intent, |
| 349 | 349 | 'action' => $action->ID, |
| 350 | 350 | ); |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | if ( $k === 'item_meta' ) { |
| 388 | 388 | foreach ( $v as $f => $value ) { |
| 389 | 389 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 390 | - $entry->metas[ absint( $f ) ] = $value; |
|
| 390 | + $entry->metas[absint( $f )] = $value; |
|
| 391 | 391 | } |
| 392 | 392 | } else { |
| 393 | 393 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -411,14 +411,14 @@ discard block |
||
| 411 | 411 | |
| 412 | 412 | foreach ( $form as $input ) { |
| 413 | 413 | $key = $input['name']; |
| 414 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 415 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 416 | - $formatted[ $key ][] = $input['value']; |
|
| 414 | + if ( isset( $formatted[$key] ) ) { |
|
| 415 | + if ( is_array( $formatted[$key] ) ) { |
|
| 416 | + $formatted[$key][] = $input['value']; |
|
| 417 | 417 | } else { |
| 418 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 418 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 419 | 419 | } |
| 420 | 420 | } else { |
| 421 | - $formatted[ $key ] = $input['value']; |
|
| 421 | + $formatted[$key] = $input['value']; |
|
| 422 | 422 | } |
| 423 | 423 | } |
| 424 | 424 | |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | |
| 659 | 659 | foreach ( $actions as $k => $action ) { |
| 660 | 660 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
| 661 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
| 661 | + $actions[$k]->post_content['amount'] = $amount; |
|
| 662 | 662 | } |
| 663 | 663 | } |
| 664 | 664 | |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | * @return array|false |
| 27 | 27 | */ |
| 28 | 28 | public static function get_details_for_form( $form_id ) { |
| 29 | - if ( ! isset( self::$details_by_form_id[ $form_id ] ) ) { |
|
| 29 | + if ( ! isset( self::$details_by_form_id[$form_id] ) ) { |
|
| 30 | 30 | self::set_details_for_form( (int) $form_id ); |
| 31 | 31 | } |
| 32 | - return self::$details_by_form_id[ $form_id ] ?? false; |
|
| 32 | + return self::$details_by_form_id[$form_id] ?? false; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - self::$details_by_form_id[ $form_id ] = array( |
|
| 93 | + self::$details_by_form_id[$form_id] = array( |
|
| 94 | 94 | 'entry' => $entry, |
| 95 | 95 | 'intent' => $intent, |
| 96 | 96 | 'payment' => $payment, |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public static function show_status( $status ) { |
| 68 | 68 | $statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() ); |
| 69 | - return $statuses[ $status ] ?? $status; |
|
| 69 | + return $statuses[$status] ?? $status; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public static function get_action_setting( $option, $atts ) { |
| 154 | 154 | $settings = self::get_action_settings( $atts ); |
| 155 | - $value = $settings[ $option ] ?? ''; |
|
| 155 | + $value = $settings[$option] ?? ''; |
|
| 156 | 156 | return $value; |
| 157 | 157 | } |
| 158 | 158 | |
@@ -255,8 +255,8 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | public static function get_repeat_label_from_value( $value, $number ) { |
| 257 | 257 | $times = self::get_plural_repeat_times( $number ); |
| 258 | - if ( isset( $times[ $value ] ) ) { |
|
| 259 | - $value = $times[ $value ]; |
|
| 258 | + if ( isset( $times[$value] ) ) { |
|
| 259 | + $value = $times[$value]; |
|
| 260 | 260 | } |
| 261 | 261 | return $value; |
| 262 | 262 | } |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | $count = 0; |
| 505 | 505 | foreach ( $payments as $payment ) { |
| 506 | 506 | if ( $payment->status === 'complete' ) { |
| 507 | - $count++; |
|
| 507 | + $count ++; |
|
| 508 | 508 | } |
| 509 | 509 | } |
| 510 | 510 | |
@@ -526,8 +526,8 @@ discard block |
||
| 526 | 526 | if ( is_array( $gateway ) ) { |
| 527 | 527 | $gateway = reset( $gateway ); |
| 528 | 528 | } |
| 529 | - if ( isset( $gateways[ $gateway ] ) ) { |
|
| 530 | - $value = $gateways[ $gateway ][ $setting ]; |
|
| 529 | + if ( isset( $gateways[$gateway] ) ) { |
|
| 530 | + $value = $gateways[$gateway][$setting]; |
|
| 531 | 531 | } |
| 532 | 532 | return $value; |
| 533 | 533 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | '<span class="frm-upgrade-submenu">' . esc_html( $cta_text ) . '</span>', |
| 117 | 117 | 'frm_view_forms', |
| 118 | 118 | 'formidable-pro-upgrade', |
| 119 | - function () { |
|
| 119 | + function() { |
|
| 120 | 120 | // This function doesn't need to do anything. |
| 121 | 121 | // The redirect is handled earlier to avoid issues with the headers being sent. |
| 122 | 122 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | unset( $addons['error'] ); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - $pro = array( |
|
| 150 | + $pro = array( |
|
| 151 | 151 | 'pro' => array( |
| 152 | 152 | 'title' => 'Formidable Forms Pro', |
| 153 | 153 | 'slug' => 'formidable-pro', |
@@ -189,9 +189,9 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | // Extract the elements to move |
| 191 | 191 | foreach ( $plans as $plan ) { |
| 192 | - if ( isset( self::$categories[ $plan ] ) ) { |
|
| 193 | - $bottom_categories[ $plan ] = self::$categories[ $plan ]; |
|
| 194 | - unset( self::$categories[ $plan ] ); |
|
| 192 | + if ( isset( self::$categories[$plan] ) ) { |
|
| 193 | + $bottom_categories[$plan] = self::$categories[$plan]; |
|
| 194 | + unset( self::$categories[$plan] ); |
|
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | |
@@ -245,14 +245,12 @@ discard block |
||
| 245 | 245 | // Add the slug to the new array. |
| 246 | 246 | $addon['category-slugs'][] = $category_slug; |
| 247 | 247 | |
| 248 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
| 249 | - self::$categories[ $category_slug ] = array( |
|
| 248 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
| 249 | + self::$categories[$category_slug] = array( |
|
| 250 | 250 | 'name' => $category, |
| 251 | 251 | 'count' => 0, |
| 252 | 252 | ); |
| 253 | - } |
|
| 254 | - |
|
| 255 | - ++self::$categories[ $category_slug ]['count']; |
|
| 253 | + } ++self::$categories[$category_slug]['count']; |
|
| 256 | 254 | } |
| 257 | 255 | } |
| 258 | 256 | |
@@ -284,7 +282,7 @@ discard block |
||
| 284 | 282 | } else { |
| 285 | 283 | foreach ( $addons as $k => $addon ) { |
| 286 | 284 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
| 287 | - unset( $addons[ $k ] ); |
|
| 285 | + unset( $addons[$k] ); |
|
| 288 | 286 | } |
| 289 | 287 | } |
| 290 | 288 | } |
@@ -398,7 +396,7 @@ discard block |
||
| 398 | 396 | |
| 399 | 397 | foreach ( $list as $k => $info ) { |
| 400 | 398 | $info['slug'] = $k; |
| 401 | - $list[ $k ] = array_merge( $defaults, $info ); |
|
| 399 | + $list[$k] = array_merge( $defaults, $info ); |
|
| 402 | 400 | } |
| 403 | 401 | return $list; |
| 404 | 402 | } |
@@ -549,17 +547,17 @@ discard block |
||
| 549 | 547 | continue; |
| 550 | 548 | } |
| 551 | 549 | |
| 552 | - $wp_plugin = $wp_plugins[ $folder ] ?? array(); |
|
| 550 | + $wp_plugin = $wp_plugins[$folder] ?? array(); |
|
| 553 | 551 | $wp_version = $wp_plugin['Version'] ?? '1.0'; |
| 554 | 552 | $plugin->slug = explode( '/', $folder )[0]; |
| 555 | 553 | |
| 556 | 554 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
| 557 | - $transient->response[ $folder ] = $plugin; |
|
| 555 | + $transient->response[$folder] = $plugin; |
|
| 558 | 556 | } else { |
| 559 | - $transient->no_update[ $folder ] = $plugin; |
|
| 557 | + $transient->no_update[$folder] = $plugin; |
|
| 560 | 558 | } |
| 561 | 559 | |
| 562 | - $transient->checked[ $folder ] = $wp_version; |
|
| 560 | + $transient->checked[$folder] = $wp_version; |
|
| 563 | 561 | |
| 564 | 562 | }//end foreach |
| 565 | 563 | |
@@ -592,7 +590,7 @@ discard block |
||
| 592 | 590 | */ |
| 593 | 591 | protected static function is_installed( $plugin ) { |
| 594 | 592 | $all_plugins = self::get_plugins(); |
| 595 | - return isset( $all_plugins[ $plugin ] ); |
|
| 593 | + return isset( $all_plugins[$plugin] ); |
|
| 596 | 594 | } |
| 597 | 595 | |
| 598 | 596 | /** |
@@ -631,13 +629,13 @@ discard block |
||
| 631 | 629 | } |
| 632 | 630 | |
| 633 | 631 | $download_id = $plugin['id'] ?? 0; |
| 634 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
| 632 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
| 635 | 633 | // if this addon is using its own license, get the update url |
| 636 | 634 | $addon_info = $api->get_api_info(); |
| 637 | 635 | |
| 638 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
| 636 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
| 639 | 637 | if ( isset( $addon_info['error'] ) ) { |
| 640 | - $version_info[ $download_id ]['error'] = array( |
|
| 638 | + $version_info[$download_id]['error'] = array( |
|
| 641 | 639 | 'message' => $addon_info['error']['message'], |
| 642 | 640 | 'code' => $addon_info['error']['code'], |
| 643 | 641 | ); |
@@ -736,8 +734,8 @@ discard block |
||
| 736 | 734 | return $addon; |
| 737 | 735 | } |
| 738 | 736 | } |
| 739 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 740 | - $plugin = $addons[ $download_id ]; |
|
| 737 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 738 | + $plugin = $addons[$download_id]; |
|
| 741 | 739 | } |
| 742 | 740 | |
| 743 | 741 | return $plugin; |
@@ -803,7 +801,7 @@ discard block |
||
| 803 | 801 | self::set_addon_status( $addon ); |
| 804 | 802 | self::set_categories( $addon ); |
| 805 | 803 | |
| 806 | - $addons[ $id ] = $addon; |
|
| 804 | + $addons[$id] = $addon; |
|
| 807 | 805 | }//end foreach |
| 808 | 806 | } |
| 809 | 807 | |
@@ -844,7 +842,7 @@ discard block |
||
| 844 | 842 | 'utm_medium' => 'addons', |
| 845 | 843 | 'utm_campaign' => 'liteplugin', |
| 846 | 844 | ); |
| 847 | - $link = add_query_arg( $query_args, $link ); |
|
| 845 | + $link = add_query_arg( $query_args, $link ); |
|
| 848 | 846 | } |
| 849 | 847 | |
| 850 | 848 | /** |
@@ -1062,7 +1060,7 @@ discard block |
||
| 1062 | 1060 | */ |
| 1063 | 1061 | public static function ajax_activate_addon() { |
| 1064 | 1062 | self::process_addon_action( |
| 1065 | - function ( $plugin ) { |
|
| 1063 | + function( $plugin ) { |
|
| 1066 | 1064 | return self::handle_addon_action( $plugin, 'activate' ); |
| 1067 | 1065 | }, |
| 1068 | 1066 | array( 'FrmAddonsController', 'get_addon_activation_response' ) |
@@ -1087,7 +1085,7 @@ discard block |
||
| 1087 | 1085 | */ |
| 1088 | 1086 | public static function ajax_deactivate_addon() { |
| 1089 | 1087 | self::process_addon_action( |
| 1090 | - function ( $plugin ) { |
|
| 1088 | + function( $plugin ) { |
|
| 1091 | 1089 | return self::handle_addon_action( $plugin, 'deactivate' ); |
| 1092 | 1090 | } |
| 1093 | 1091 | ); |
@@ -1102,7 +1100,7 @@ discard block |
||
| 1102 | 1100 | */ |
| 1103 | 1101 | public static function ajax_uninstall_addon() { |
| 1104 | 1102 | self::process_addon_action( |
| 1105 | - function ( $plugin ) { |
|
| 1103 | + function( $plugin ) { |
|
| 1106 | 1104 | return self::handle_addon_action( $plugin, 'uninstall' ); |
| 1107 | 1105 | } |
| 1108 | 1106 | ); |
@@ -1500,7 +1498,7 @@ discard block |
||
| 1500 | 1498 | $addons = $api->get_api_info(); |
| 1501 | 1499 | |
| 1502 | 1500 | if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) { |
| 1503 | - $dates = $addons[ $addon_id ]; |
|
| 1501 | + $dates = $addons[$addon_id]; |
|
| 1504 | 1502 | $requires = FrmFormsHelper::get_plan_required( $dates ); |
| 1505 | 1503 | } |
| 1506 | 1504 | |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $event_labels = FrmFormAction::trigger_labels(); |
| 44 | 44 | foreach ( $action_control->action_options['event'] as $event ) { |
| 45 | 45 | ?> |
| 46 | - <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[ $event ] ?? $event ); ?></option> |
|
| 46 | + <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[$event] ?? $event ); ?></option> |
|
| 47 | 47 | <?php } ?> |
| 48 | 48 | </select> |
| 49 | 49 | </p> |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | ?> |
| 41 | 41 | <p class="frm6 frm_form_field"> |
| 42 | 42 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
| 43 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
| 43 | + <?php echo esc_html( $labels[$option] ); ?> |
|
| 44 | 44 | </label> |
| 45 | 45 | <span class="frm-with-right-icon"> |
| 46 | 46 | <input |
| 47 | 47 | type="text" |
| 48 | 48 | name="<?php echo esc_attr( $input_name ); ?>" |
| 49 | 49 | id="<?php echo esc_attr( $input_id ); ?>" |
| 50 | - value="<?php echo esc_attr( $default_value[ $sub_field['name'] ] ?? '' ); ?>" |
|
| 50 | + value="<?php echo esc_attr( $default_value[$sub_field['name']] ?? '' ); ?>" |
|
| 51 | 51 | data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>" |
| 52 | 52 | data-changeatt="value" |
| 53 | 53 | /> |
@@ -73,13 +73,13 @@ discard block |
||
| 73 | 73 | ?> |
| 74 | 74 | <p class="frm6 frm_form_field"> |
| 75 | 75 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
| 76 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
| 76 | + <?php echo esc_html( $labels[$option] ); ?> |
|
| 77 | 77 | </label> |
| 78 | 78 | <input |
| 79 | 79 | type="text" |
| 80 | 80 | name="<?php echo esc_attr( $input_name ); ?>" |
| 81 | 81 | id="<?php echo esc_attr( $input_id ); ?>" |
| 82 | - value="<?php echo esc_attr( $input_value[ $sub_field['name'] ] ?? '' ); ?>" |
|
| 82 | + value="<?php echo esc_attr( $input_value[$sub_field['name']] ?? '' ); ?>" |
|
| 83 | 83 | data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>" |
| 84 | 84 | data-changeatt="<?php echo esc_attr( $option ); ?>" |
| 85 | 85 | /> |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ?> |
| 96 | 96 | <p class="frm_form_field frm-flex-col"> |
| 97 | 97 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
| 98 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
| 98 | + <?php echo esc_html( $labels[$option] ); ?> |
|
| 99 | 99 | </label> |
| 100 | 100 | <textarea |
| 101 | 101 | name="<?php echo esc_attr( $input_name ); ?>" |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $sub_field_class = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}"; |
| 42 | 42 | $sub_field_desc = FrmField::get_option( $field, $name . '_desc' ); |
| 43 | 43 | |
| 44 | - if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) { |
|
| 44 | + if ( isset( $errors['field' . $field_id . '-' . $name] ) ) { |
|
| 45 | 45 | $sub_field_class .= ' frm_blank_field'; |
| 46 | 46 | } |
| 47 | 47 | ?> |
@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | $attrs = array( |
| 61 | 61 | 'type' => $sub_field['type'], |
| 62 | 62 | 'id' => $html_id . '_' . $name, |
| 63 | - 'value' => $field_value[ $name ] ?? '', |
|
| 63 | + 'value' => $field_value[$name] ?? '', |
|
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | - if ( ! empty( $field_value[ $name ] ) ) { |
|
| 67 | - $attrs['data-frmval'] = $field_value[ $name ]; |
|
| 66 | + if ( ! empty( $field_value[$name] ) ) { |
|
| 67 | + $attrs['data-frmval'] = $field_value[$name]; |
|
| 68 | 68 | } |
| 69 | 69 | if ( empty( $args['remove_names'] ) ) { |
| 70 | 70 | $attrs['name'] = $field_name . '[' . $name . ']'; |
@@ -81,9 +81,9 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // Don't show individual field errors when there is a combo field error. |
| 84 | - if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) { |
|
| 84 | + if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) { |
|
| 85 | 85 | ?> |
| 86 | - <div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div> |
|
| 86 | + <div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div> |
|
| 87 | 87 | <?php } ?> |
| 88 | 88 | </div> |
| 89 | 89 | <?php |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $info['url'] = $xml; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - $disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : ''; |
|
| 14 | + $disabled = isset( $imported[$info['form']] ) ? ' disabled' : ''; |
|
| 15 | 15 | $url = $info['url'] ?? ''; |
| 16 | 16 | $value = $importing === 'form' ? $info['form'] : $info['key']; |
| 17 | 17 | if ( ! isset( $info['img'] ) ) { |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | continue; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) ); |
|
| 24 | + $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) ); |
|
| 25 | 25 | ?> |
| 26 | 26 | <div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>"> |
| 27 | 27 | <?php if ( $importing === 'form' ) { ?> |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | if ( $importing === 'form' && $disabled ) { |
| 57 | - FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) ); |
|
| 57 | + FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) ); |
|
| 58 | 58 | } else { |
| 59 | 59 | echo esc_html( $info['name'] ); |
| 60 | 60 | } |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | FrmFieldGdprHelper::FIELD_TYPE => FrmFieldGdprHelper::get_gdpr_field_class( $field_type ), |
| 113 | 113 | ); |
| 114 | 114 | |
| 115 | - $class = $type_classes[ $field_type ] ?? ''; |
|
| 115 | + $class = $type_classes[$field_type] ?? ''; |
|
| 116 | 116 | |
| 117 | 117 | return apply_filters( 'frm_get_field_type_class', $class, $field_type ); |
| 118 | 118 | } |