@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | 'sort' => '', |
| 151 | 151 | 'sdir' => '', |
| 152 | 152 | ) as $var => $default ) { |
| 153 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default ); |
|
| 153 | + $values[$var] = FrmAppHelper::get_param( $var, $default ); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | return $values; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | public static function display_list( $response = array() ) { |
| 167 | 167 | FrmAppHelper::include_svg(); |
| 168 | 168 | |
| 169 | - $defaults = array( |
|
| 169 | + $defaults = array( |
|
| 170 | 170 | 'errors' => array(), |
| 171 | 171 | 'message' => '', |
| 172 | 172 | ); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $is_stripe = $gateway === 'stripe' || ( is_array( $gateway ) && in_array( 'stripe', $gateway, true ) ); |
| 79 | 79 | |
| 80 | 80 | if ( ! $is_stripe || empty( $payment_action->post_content['amount'] ) ) { |
| 81 | - unset( $payment_actions[ $k ] ); |
|
| 81 | + unset( $payment_actions[$k] ); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | |
| 525 | 525 | foreach ( $settings as $k => $s ) { |
| 526 | 526 | if ( is_string( $s ) ) { |
| 527 | - $settings[ $k ] = str_replace( $disallowed, '', $s ); |
|
| 527 | + $settings[$k] = str_replace( $disallowed, '', $s ); |
|
| 528 | 528 | } |
| 529 | 529 | } |
| 530 | 530 | |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | * @return array |
| 653 | 653 | */ |
| 654 | 654 | public static function remove_cc_validation( $errors, $field, $values ) { |
| 655 | - $has_processed = isset( $_POST[ 'frmintent' . $field->form_id ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 655 | + $has_processed = isset( $_POST['frmintent' . $field->form_id] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 656 | 656 | |
| 657 | 657 | if ( ! $has_processed ) { |
| 658 | 658 | return $errors; |
@@ -660,12 +660,12 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | $field_id = $field->temp_id ?? $field->id; |
| 662 | 662 | |
| 663 | - if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) { |
|
| 664 | - unset( $errors[ 'field' . $field_id . '-cc' ] ); |
|
| 663 | + if ( isset( $errors['field' . $field_id . '-cc'] ) ) { |
|
| 664 | + unset( $errors['field' . $field_id . '-cc'] ); |
|
| 665 | 665 | } |
| 666 | 666 | |
| 667 | - if ( isset( $errors[ 'field' . $field_id ] ) ) { |
|
| 668 | - unset( $errors[ 'field' . $field_id ] ); |
|
| 667 | + if ( isset( $errors['field' . $field_id] ) ) { |
|
| 668 | + unset( $errors['field' . $field_id] ); |
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | return $errors; |
@@ -170,20 +170,20 @@ discard block |
||
| 170 | 170 | global $frm_vars; |
| 171 | 171 | $form_id = FrmForm::get_current_form_id(); |
| 172 | 172 | |
| 173 | - $columns[ $form_id . '_id' ] = 'ID'; |
|
| 174 | - $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 173 | + $columns[$form_id . '_id'] = 'ID'; |
|
| 174 | + $columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 175 | 175 | |
| 176 | 176 | if ( $form_id ) { |
| 177 | 177 | self::get_columns_for_form( $form_id, $columns ); |
| 178 | 178 | } else { |
| 179 | - $columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' ); |
|
| 180 | - $columns[ $form_id . '_name' ] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 181 | - $columns[ $form_id . '_user_id' ] = esc_html__( 'Created By', 'formidable' ); |
|
| 179 | + $columns[$form_id . '_form_id'] = esc_html__( 'Form', 'formidable' ); |
|
| 180 | + $columns[$form_id . '_name'] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 181 | + $columns[$form_id . '_user_id'] = esc_html__( 'Created By', 'formidable' ); |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - $columns[ $form_id . '_is_draft' ] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 185 | - $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' ); |
|
| 186 | - $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' ); |
|
| 184 | + $columns[$form_id . '_is_draft'] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 185 | + $columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' ); |
|
| 186 | + $columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' ); |
|
| 187 | 187 | self::maybe_add_ip_col( $form_id, $columns ); |
| 188 | 188 | |
| 189 | 189 | $frm_vars['cols'] = $columns; |
@@ -256,10 +256,10 @@ discard block |
||
| 256 | 256 | |
| 257 | 257 | foreach ( $sub_form_cols as $k => $sub_form_col ) { |
| 258 | 258 | if ( FrmField::is_no_save_field( $sub_form_col->type ) ) { |
| 259 | - unset( $sub_form_cols[ $k ] ); |
|
| 259 | + unset( $sub_form_cols[$k] ); |
|
| 260 | 260 | continue; |
| 261 | 261 | } |
| 262 | - $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 262 | + $columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 263 | 263 | unset( $sub_form_col ); |
| 264 | 264 | } |
| 265 | 265 | } |
@@ -285,10 +285,10 @@ discard block |
||
| 285 | 285 | $include_column_for_sep_val = $has_separate_value && ! $is_post_status; |
| 286 | 286 | |
| 287 | 287 | if ( $include_column_for_sep_val ) { |
| 288 | - $columns[ $form_id . '_frmsep_' . $col_id ] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val ); |
|
| 288 | + $columns[$form_id . '_frmsep_' . $col_id] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val ); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - $columns[ $form_id . '_' . $col_id ] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val, false ); |
|
| 291 | + $columns[$form_id . '_' . $col_id] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val, false ); |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /** |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | */ |
| 323 | 323 | private static function maybe_add_ip_col( $form_id, &$columns ) { |
| 324 | 324 | if ( FrmAppHelper::ips_saved() ) { |
| 325 | - $columns[ $form_id . '_ip' ] = 'IP'; |
|
| 325 | + $columns[$form_id . '_ip'] = 'IP'; |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | foreach ( $meta_value as $mk => $mv ) { |
| 383 | 383 | // Remove blank values. |
| 384 | 384 | if ( empty( $mv ) ) { |
| 385 | - unset( $meta_value[ $mk ] ); |
|
| 385 | + unset( $meta_value[$mk] ); |
|
| 386 | 386 | } |
| 387 | 387 | } |
| 388 | 388 | |
@@ -479,14 +479,14 @@ discard block |
||
| 479 | 479 | ); |
| 480 | 480 | |
| 481 | 481 | if ( ! $form_id ) { |
| 482 | - $columns[ $form_id . '_user_id' ] = 'user_id'; |
|
| 483 | - $columns[ $form_id . '_name' ] = 'name'; |
|
| 484 | - $columns[ $form_id . '_form_id' ] = 'form_id'; |
|
| 482 | + $columns[$form_id . '_user_id'] = 'user_id'; |
|
| 483 | + $columns[$form_id . '_name'] = 'name'; |
|
| 484 | + $columns[$form_id . '_form_id'] = 'form_id'; |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | foreach ( $fields as $field ) { |
| 488 | 488 | if ( self::field_supports_sorting( $field ) ) { |
| 489 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
| 489 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
| 490 | 490 | } |
| 491 | 491 | } |
| 492 | 492 | |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | |
| 594 | 594 | if ( ! $result || ! in_array( $col_key, $result, true ) ) { |
| 595 | 595 | $result[] = $col_key; |
| 596 | - --$i; |
|
| 596 | + -- $i; |
|
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | unset( $col_key, $col ); |
@@ -770,9 +770,9 @@ discard block |
||
| 770 | 770 | if ( ! isset( $frm_vars['form_params'] ) ) { |
| 771 | 771 | $frm_vars['form_params'] = array(); |
| 772 | 772 | } |
| 773 | - $frm_vars['form_params'][ $form->id ] = $params; |
|
| 773 | + $frm_vars['form_params'][$form->id] = $params; |
|
| 774 | 774 | |
| 775 | - if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) { |
|
| 775 | + if ( isset( $frm_vars['created_entries'][$form_id] ) ) { |
|
| 776 | 776 | return; |
| 777 | 777 | } |
| 778 | 778 | |
@@ -789,17 +789,17 @@ discard block |
||
| 789 | 789 | */ |
| 790 | 790 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
| 791 | 791 | |
| 792 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
| 792 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
| 793 | 793 | |
| 794 | 794 | if ( ! $errors ) { |
| 795 | 795 | $_POST['frm_skip_cookie'] = 1; |
| 796 | 796 | $do_success = false; |
| 797 | 797 | |
| 798 | 798 | if ( $params['action'] === 'create' ) { |
| 799 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
| 800 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 799 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
| 800 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 801 | 801 | |
| 802 | - $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id']; |
|
| 802 | + $params['id'] = $frm_vars['created_entries'][$form_id]['entry_id']; |
|
| 803 | 803 | $do_success = true; |
| 804 | 804 | } |
| 805 | 805 | } |
@@ -926,7 +926,7 @@ discard block |
||
| 926 | 926 | $atts = shortcode_atts( $defaults, $atts ); |
| 927 | 927 | |
| 928 | 928 | if ( $atts['default_email'] ) { |
| 929 | - $shortcode_atts = array( |
|
| 929 | + $shortcode_atts = array( |
|
| 930 | 930 | 'format' => $atts['format'], |
| 931 | 931 | 'plain_text' => $atts['plain_text'], |
| 932 | 932 | ); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | return; |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | - $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : ''; |
|
| 171 | + $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : ''; |
|
| 172 | 172 | |
| 173 | 173 | if ( ! $selected_xml || ! str_starts_with( $selected_xml, 'http' ) ) { |
| 174 | 174 | return; |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | * @return string |
| 187 | 187 | */ |
| 188 | 188 | private static function get_selected_in_form( $form, $value = 'form' ) { |
| 189 | - if ( $form && ! empty( $form[ $value ] ) ) { |
|
| 190 | - return $form[ $value ]; |
|
| 189 | + if ( $form && ! empty( $form[$value] ) ) { |
|
| 190 | + return $form[$value]; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | return ''; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | if ( $for === 'view' ) { |
| 219 | - $item_key = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys; |
|
| 219 | + $item_key = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys; |
|
| 220 | 220 | $shortcode = '[display-frm-data id=%1$s filter=limited]'; |
| 221 | 221 | } elseif ( $for === 'form' ) { |
| 222 | 222 | $item_key = $form_key; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | continue; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - $page_ids[ $for ] = wp_insert_post( |
|
| 234 | + $page_ids[$for] = wp_insert_post( |
|
| 235 | 235 | array( |
| 236 | 236 | 'post_title' => $name, |
| 237 | 237 | 'post_type' => 'page', |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | $file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] ); |
| 390 | 390 | $file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) ); |
| 391 | 391 | |
| 392 | - if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) { |
|
| 392 | + if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) { |
|
| 393 | 393 | // allow other file types to be imported |
| 394 | 394 | do_action( 'frm_before_import_' . $file_type ); |
| 395 | 395 | |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | foreach ( $type as $tb_type ) { |
| 491 | 491 | $where = array(); |
| 492 | 492 | $join = ''; |
| 493 | - $table = $tables[ $tb_type ]; |
|
| 493 | + $table = $tables[$tb_type]; |
|
| 494 | 494 | $select = $table . '.id'; |
| 495 | 495 | $query_vars = array(); |
| 496 | 496 | |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | $table . '.parent_form_id' => $args['ids'], |
| 505 | 505 | ); |
| 506 | 506 | } else { |
| 507 | - $where[ $table . '.status !' ] = 'draft'; |
|
| 507 | + $where[$table . '.status !'] = 'draft'; |
|
| 508 | 508 | } |
| 509 | 509 | break; |
| 510 | 510 | case 'actions': |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | case 'items': |
| 519 | 519 | // $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)"; |
| 520 | 520 | if ( $args['ids'] ) { |
| 521 | - $where[ $table . '.form_id' ] = $args['ids']; |
|
| 521 | + $where[$table . '.form_id'] = $args['ids']; |
|
| 522 | 522 | } |
| 523 | 523 | break; |
| 524 | 524 | case 'styles': |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | } |
| 563 | 563 | }//end switch |
| 564 | 564 | |
| 565 | - $records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select ); |
|
| 565 | + $records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select ); |
|
| 566 | 566 | unset( $tb_type ); |
| 567 | 567 | }//end foreach |
| 568 | 568 | |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | |
| 774 | 774 | foreach ( $csv_fields as $k => $f ) { |
| 775 | 775 | if ( in_array( $f->type, $no_export_fields, true ) ) { |
| 776 | - unset( $csv_fields[ $k ] ); |
|
| 776 | + unset( $csv_fields[$k] ); |
|
| 777 | 777 | } |
| 778 | 778 | } |
| 779 | 779 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | /** |
| 161 | 161 | * Update the form data on the "Manage Styles" tab after global settings are saved. |
| 162 | 162 | */ |
| 163 | - function () { |
|
| 163 | + function() { |
|
| 164 | 164 | self::manage_styles(); |
| 165 | 165 | } |
| 166 | 166 | ); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | |
| 439 | 439 | if ( ! $form_id ) { |
| 440 | 440 | // Fallback to any form. |
| 441 | - $where = array( |
|
| 441 | + $where = array( |
|
| 442 | 442 | 'status' => 'published', |
| 443 | 443 | // Make sure it's not a repeater. |
| 444 | 444 | 'parent_form_id' => array( null, 0 ), |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | private static function disable_admin_page_styling_on_submit_buttons() { |
| 458 | 458 | add_filter( |
| 459 | 459 | 'frm_submit_button_class', |
| 460 | - function ( $classes ) { |
|
| 460 | + function( $classes ) { |
|
| 461 | 461 | $classes[] = 'frm_no_style_button'; |
| 462 | 462 | return $classes; |
| 463 | 463 | } |
@@ -689,13 +689,13 @@ discard block |
||
| 689 | 689 | private static function force_form_style( $style ) { |
| 690 | 690 | add_filter( |
| 691 | 691 | 'frm_add_form_style_class', |
| 692 | - function ( $class ) use ( $style ) { |
|
| 693 | - $split = array_filter( |
|
| 692 | + function( $class ) use ( $style ) { |
|
| 693 | + $split = array_filter( |
|
| 694 | 694 | explode( ' ', $class ), |
| 695 | 695 | /** |
| 696 | 696 | * @param string $class |
| 697 | 697 | */ |
| 698 | - function ( $class ) { |
|
| 698 | + function( $class ) { |
|
| 699 | 699 | return $class && ! str_starts_with( $class, 'frm_style_' ); |
| 700 | 700 | } |
| 701 | 701 | ); |
@@ -821,11 +821,11 @@ discard block |
||
| 821 | 821 | $forms = FrmForm::get_published_forms(); |
| 822 | 822 | |
| 823 | 823 | foreach ( $forms as $form ) { |
| 824 | - if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 824 | + if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 825 | 825 | continue; |
| 826 | 826 | } |
| 827 | 827 | |
| 828 | - $new_style = sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 828 | + $new_style = sanitize_text_field( wp_unslash( $_POST['style'][$form->id] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 829 | 829 | |
| 830 | 830 | $form->options['custom_style'] = $new_style; |
| 831 | 831 | $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) ); |
@@ -1282,8 +1282,8 @@ discard block |
||
| 1282 | 1282 | public static function get_style_val( $val, $form = 'default' ) { |
| 1283 | 1283 | $style = self::get_form_style( $form ); |
| 1284 | 1284 | |
| 1285 | - if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
| 1286 | - return $style->post_content[ $val ]; |
|
| 1285 | + if ( $style && isset( $style->post_content[$val] ) ) { |
|
| 1286 | + return $style->post_content[$val]; |
|
| 1287 | 1287 | } |
| 1288 | 1288 | |
| 1289 | 1289 | return null; |
@@ -1310,7 +1310,7 @@ discard block |
||
| 1310 | 1310 | } elseif ( 'alt_bg_color' === $name ) { |
| 1311 | 1311 | $setting = 'bg_color_active'; |
| 1312 | 1312 | } |
| 1313 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
| 1313 | + $default_styles[$name] = $style->post_content[$setting]; |
|
| 1314 | 1314 | unset( $name, $val ); |
| 1315 | 1315 | } |
| 1316 | 1316 | |
@@ -1366,16 +1366,16 @@ discard block |
||
| 1366 | 1366 | $i = 0; |
| 1367 | 1367 | $first_open = false; |
| 1368 | 1368 | |
| 1369 | - if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) { |
|
| 1369 | + if ( isset( $wp_meta_boxes[$page][$context] ) ) { |
|
| 1370 | 1370 | foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { |
| 1371 | - if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { |
|
| 1372 | - foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { |
|
| 1371 | + if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) { |
|
| 1372 | + foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) { |
|
| 1373 | 1373 | if ( false === $box || ! $box['title'] ) { |
| 1374 | 1374 | continue; |
| 1375 | 1375 | } |
| 1376 | 1376 | |
| 1377 | - ++$i; |
|
| 1378 | - $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[ $box['id'] ] : 'frm-' . $box['id']; |
|
| 1377 | + ++ $i; |
|
| 1378 | + $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[$box['id']] : 'frm-' . $box['id']; |
|
| 1379 | 1379 | $open_class = ''; |
| 1380 | 1380 | |
| 1381 | 1381 | if ( ! $first_open ) { |
@@ -67,19 +67,19 @@ discard block |
||
| 67 | 67 | $result = array(); |
| 68 | 68 | |
| 69 | 69 | foreach ( $names as $name ) { |
| 70 | - if ( empty( $this->sub_fields[ $name ] ) ) { |
|
| 70 | + if ( empty( $this->sub_fields[$name] ) ) { |
|
| 71 | 71 | continue; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if ( ! isset( $this->sub_fields[ $name ]['wrapper_classes'] ) ) { |
|
| 75 | - $this->sub_fields[ $name ]['wrapper_classes'] = $col_class; |
|
| 76 | - } elseif ( is_array( $this->sub_fields[ $name ]['wrapper_classes'] ) ) { |
|
| 77 | - $this->sub_fields[ $name ]['wrapper_classes'] = implode( ' ', $this->sub_fields[ $name ]['wrapper_classes'] ) . ' ' . $col_class; |
|
| 74 | + if ( ! isset( $this->sub_fields[$name]['wrapper_classes'] ) ) { |
|
| 75 | + $this->sub_fields[$name]['wrapper_classes'] = $col_class; |
|
| 76 | + } elseif ( is_array( $this->sub_fields[$name]['wrapper_classes'] ) ) { |
|
| 77 | + $this->sub_fields[$name]['wrapper_classes'] = implode( ' ', $this->sub_fields[$name]['wrapper_classes'] ) . ' ' . $col_class; |
|
| 78 | 78 | } else { |
| 79 | - $this->sub_fields[ $name ]['wrapper_classes'] .= ' ' . $col_class; |
|
| 79 | + $this->sub_fields[$name]['wrapper_classes'] .= ' ' . $col_class; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - $result[ $name ] = $this->sub_fields[ $name ]; |
|
| 82 | + $result[$name] = $this->sub_fields[$name]; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | return $result; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // Default desc. |
| 114 | 114 | foreach ( $this->sub_fields as $name => $sub_field ) { |
| 115 | - $extra_options[ $name . '_desc' ] = $sub_field['label']; |
|
| 115 | + $extra_options[$name . '_desc'] = $sub_field['label']; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | return $extra_options; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $name_layout = $this->get_name_layout(); |
| 152 | 152 | |
| 153 | 153 | if ( ! empty( $atts['show'] ) ) { |
| 154 | - return $value[ $atts['show'] ] ?? ''; |
|
| 154 | + return $value[$atts['show']] ?? ''; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | $value = wp_parse_args( |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $args['sub_fields'] = $this->sub_fields; |
| 232 | 232 | |
| 233 | 233 | foreach ( $hidden_fields as $name => $hidden_field ) { |
| 234 | - $args['sub_fields'][ $name ]['wrapper_classes'] .= ' frm_hidden'; |
|
| 234 | + $args['sub_fields'][$name]['wrapper_classes'] .= ' frm_hidden'; |
|
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 | } |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | public static function track_first_name_field( $fields ) { |
| 317 | 317 | foreach ( $fields as $field ) { |
| 318 | 318 | if ( 'name' === $field->type ) { |
| 319 | - self::$first_name_field_ids[ $field->form_id ] = $field->id; |
|
| 319 | + self::$first_name_field_ids[$field->form_id] = $field->id; |
|
| 320 | 320 | return; |
| 321 | 321 | } |
| 322 | 322 | } |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | $attrs = parent::get_sub_field_input_attrs( $sub_field, $args ); |
| 337 | 337 | $form_id = (int) ( is_array( $args['field'] ) ? $args['field']['form_id'] : $args['field']->form_id ); |
| 338 | 338 | |
| 339 | - if ( ! self::$first_name_field_ids || empty( self::$first_name_field_ids[ $form_id ] ) ) { |
|
| 339 | + if ( ! self::$first_name_field_ids || empty( self::$first_name_field_ids[$form_id] ) ) { |
|
| 340 | 340 | return $attrs; |
| 341 | 341 | } |
| 342 | 342 | |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | |
| 350 | 350 | $field_id = (int) ( is_array( $args['field'] ) ? $args['field']['id'] : $args['field']->id ); |
| 351 | 351 | |
| 352 | - if ( intval( self::$first_name_field_ids[ $form_id ] ) === $field_id ) { |
|
| 352 | + if ( intval( self::$first_name_field_ids[$form_id] ) === $field_id ) { |
|
| 353 | 353 | if ( 'first' === $sub_field['name'] ) { |
| 354 | 354 | $attrs['autocomplete'] = 'given-name'; |
| 355 | 355 | } elseif ( 'last' === $sub_field['name'] ) { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | public function add_settings( $sections ) { |
| 207 | 207 | wp_enqueue_style( 'formidable-pro-fields' ); |
| 208 | - $sections[ $this->plugin_slug ] = array( |
|
| 208 | + $sections[$this->plugin_slug] = array( |
|
| 209 | 209 | 'class' => $this, |
| 210 | 210 | 'function' => 'settings_page', |
| 211 | 211 | 'name' => $this->plugin_name(), |
@@ -377,9 +377,9 @@ discard block |
||
| 377 | 377 | // Set the current step. |
| 378 | 378 | if ( ! isset( $step['current'] ) ) { |
| 379 | 379 | if ( $step['complete'] ) { |
| 380 | - $steps[ $k ]['current'] = false; |
|
| 380 | + $steps[$k]['current'] = false; |
|
| 381 | 381 | } else { |
| 382 | - $steps[ $k ]['current'] = ! $has_current; |
|
| 382 | + $steps[$k]['current'] = ! $has_current; |
|
| 383 | 383 | $has_current = true; |
| 384 | 384 | } |
| 385 | 385 | } elseif ( $step['current'] ) { |
@@ -390,10 +390,10 @@ discard block |
||
| 390 | 390 | $class = $step['button_class'] ?? ''; |
| 391 | 391 | $class .= ' button-primary frm-button-primary'; |
| 392 | 392 | |
| 393 | - if ( ! $steps[ $k ]['current'] ) { |
|
| 393 | + if ( ! $steps[$k]['current'] ) { |
|
| 394 | 394 | $class .= ' frm_grey disabled'; |
| 395 | 395 | } |
| 396 | - $steps[ $k ]['button_class'] = $class; |
|
| 396 | + $steps[$k]['button_class'] = $class; |
|
| 397 | 397 | }//end foreach |
| 398 | 398 | |
| 399 | 399 | return $steps; |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | $api = new FrmFormApi(); |
| 564 | 564 | $addons = $api->get_api_info(); |
| 565 | 565 | $id = $this->download_id(); |
| 566 | - $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] ); |
|
| 566 | + $has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] ); |
|
| 567 | 567 | |
| 568 | 568 | if ( ! $step['current'] ) { |
| 569 | 569 | ?> |
@@ -578,10 +578,10 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | if ( ! $has_file ) { |
| 580 | 580 | echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>'; |
| 581 | - } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) { |
|
| 581 | + } elseif ( ! isset( $addons[$id]['beta']['package'] ) ) { |
|
| 582 | 582 | echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>'; |
| 583 | 583 | } else { |
| 584 | - $xml = $addons[ $id ]['beta']['package']; |
|
| 584 | + $xml = $addons[$id]['beta']['package']; |
|
| 585 | 585 | |
| 586 | 586 | if ( is_array( $xml ) ) { |
| 587 | 587 | $xml = reset( $xml ); |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | foreach ( $options as $info ) { |
| 663 | 663 | // Count the number of options displayed for css. |
| 664 | 664 | if ( $count > 1 && ! isset( $info['img'] ) ) { |
| 665 | - --$count; |
|
| 665 | + -- $count; |
|
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 | |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false; |
| 762 | 762 | |
| 763 | 763 | if ( $was_imported ) { |
| 764 | - $imported[ $form['form'] ] = $was_imported; |
|
| 764 | + $imported[$form['form']] = $was_imported; |
|
| 765 | 765 | } |
| 766 | 766 | } |
| 767 | 767 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | global $wpdb; |
| 58 | 58 | |
| 59 | - $values = array( |
|
| 59 | + $values = array( |
|
| 60 | 60 | 'item_id' => $entry_id, |
| 61 | 61 | 'field_id' => $field_id, |
| 62 | 62 | ); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - $values_indexed_by_field_id[ $field_id ] = $meta_value; |
|
| 152 | + $values_indexed_by_field_id[$field_id] = $meta_value; |
|
| 153 | 153 | |
| 154 | 154 | self::get_value_to_save( compact( 'field', 'field_id', 'entry_id' ), $meta_value ); |
| 155 | 155 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | if ( $meta_value === array() || ( ! is_array( $meta_value ) && trim( $meta_value ) === '' ) ) { |
| 160 | 160 | // Remove blank fields. |
| 161 | - unset( $values_indexed_by_field_id[ $field_id ] ); |
|
| 161 | + unset( $values_indexed_by_field_id[$field_id] ); |
|
| 162 | 162 | } else { |
| 163 | 163 | // if value exists, then update it |
| 164 | 164 | self::update_entry_meta( $entry_id, $field_id, '', $meta_value ); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | public static function get_meta_value( $entry, $field_id ) { |
| 254 | 254 | if ( isset( $entry->metas ) ) { |
| 255 | - return $entry->metas[ $field_id ] ?? false; |
|
| 255 | + return $entry->metas[$field_id] ?? false; |
|
| 256 | 256 | } |
| 257 | 257 | return self::get_entry_meta_by_field( $entry->id, $field_id ); |
| 258 | 258 | } |
@@ -275,8 +275,8 @@ discard block |
||
| 275 | 275 | $cached = FrmDb::check_cache( $entry_id, 'frm_entry' ); |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) { |
|
| 279 | - $result = $cached->metas[ $field_id ]; |
|
| 278 | + if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) { |
|
| 279 | + $result = $cached->metas[$field_id]; |
|
| 280 | 280 | |
| 281 | 281 | return wp_unslash( $result ); |
| 282 | 282 | } |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | foreach ( $values as $k => $v ) { |
| 330 | 330 | FrmAppHelper::unserialize_or_decode( $v ); |
| 331 | - $values[ $k ] = $v; |
|
| 331 | + $values[$k] = $v; |
|
| 332 | 332 | unset( $k, $v ); |
| 333 | 333 | } |
| 334 | 334 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | foreach ( $results as $k => $result ) { |
| 405 | 405 | FrmAppHelper::unserialize_or_decode( $result->meta_value ); |
| 406 | - $results[ $k ]->meta_value = wp_unslash( $result->meta_value ); |
|
| 406 | + $results[$k]->meta_value = wp_unslash( $result->meta_value ); |
|
| 407 | 407 | unset( $k, $result ); |
| 408 | 408 | } |
| 409 | 409 | |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | } elseif ( str_contains( $args['is_draft'], ',' ) ) { |
| 537 | 537 | $is_draft = array_reduce( |
| 538 | 538 | explode( ',', $args['is_draft'] ), |
| 539 | - function ( $total, $current ) { |
|
| 539 | + function( $total, $current ) { |
|
| 540 | 540 | if ( is_numeric( $current ) ) { |
| 541 | 541 | $total[] = absint( $current ); |
| 542 | 542 | } |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | * @return void |
| 62 | 62 | */ |
| 63 | 63 | private function _set( $param, $atts ) { |
| 64 | - if ( isset( $atts[ $param ] ) ) { |
|
| 65 | - $this->{$param} = $atts[ $param ]; |
|
| 64 | + if ( isset( $atts[$param] ) ) { |
|
| 65 | + $this->{$param} = $atts[$param]; |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | $exclude = array( 'field_obj', 'html' ); |
| 114 | 114 | |
| 115 | 115 | foreach ( $exclude as $ex ) { |
| 116 | - if ( isset( $atts[ $ex ] ) ) { |
|
| 117 | - unset( $this->pass_args[ $ex ] ); |
|
| 116 | + if ( isset( $atts[$ex] ) ) { |
|
| 117 | + unset( $this->pass_args[$ex] ); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | } |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | * @return void |
| 129 | 129 | */ |
| 130 | 130 | private function set_from_field( $atts, $set ) { |
| 131 | - if ( isset( $atts[ $set['param'] ] ) ) { |
|
| 132 | - $this->{$set['param']} = $atts[ $set['param'] ]; |
|
| 131 | + if ( isset( $atts[$set['param']] ) ) { |
|
| 132 | + $this->{$set['param']} = $atts[$set['param']]; |
|
| 133 | 133 | } else { |
| 134 | 134 | $this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] ); |
| 135 | 135 | } |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | private function replace_error_shortcode() { |
| 288 | 288 | $this->maybe_add_error_id(); |
| 289 | - $error = $this->pass_args['errors'][ 'field' . $this->field_id ] ?? false; |
|
| 289 | + $error = $this->pass_args['errors']['field' . $this->field_id] ?? false; |
|
| 290 | 290 | |
| 291 | 291 | if ( $error && ! str_contains( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) { |
| 292 | 292 | $error_body = self::get_error_body( $this->html ); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | * @return void |
| 333 | 333 | */ |
| 334 | 334 | private function maybe_add_error_id() { |
| 335 | - if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 335 | + if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 336 | 336 | return; |
| 337 | 337 | } |
| 338 | 338 | |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER ); |
| 425 | 425 | |
| 426 | 426 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 427 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 427 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 428 | 428 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 429 | 429 | $replace_with = ''; |
| 430 | 430 | |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | $replace_with = $this->replace_input_shortcode( $shortcode_atts ); |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | - $this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html ); |
|
| 437 | + $this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html ); |
|
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | private function prepare_input_shortcode_atts( $shortcode_atts ) { |
| 458 | 458 | if ( isset( $shortcode_atts['opt'] ) ) { |
| 459 | - --$shortcode_atts['opt']; |
|
| 459 | + -- $shortcode_atts['opt']; |
|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | $field_class = $shortcode_atts['class'] ?? ''; |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | */ |
| 527 | 527 | private function get_field_div_classes() { |
| 528 | 528 | // Add error class |
| 529 | - $classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : ''; |
|
| 529 | + $classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : ''; |
|
| 530 | 530 | |
| 531 | 531 | // Add label position class |
| 532 | 532 | $settings = $this->field_obj->display_field_settings(); |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | // Add 'aria-invalid' attribute to the group if there are errors. |
| 612 | - if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 612 | + if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 613 | 613 | $attributes['aria-invalid'] = 'true'; |
| 614 | 614 | } |
| 615 | 615 | |