@@ -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 | |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | foreach ( $meta_value as $mk => $mv ) { |
| 381 | 381 | // Remove blank values. |
| 382 | 382 | if ( empty( $mv ) ) { |
| 383 | - unset( $meta_value[ $mk ] ); |
|
| 383 | + unset( $meta_value[$mk] ); |
|
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | |
@@ -476,14 +476,14 @@ discard block |
||
| 476 | 476 | ); |
| 477 | 477 | |
| 478 | 478 | if ( ! $form_id ) { |
| 479 | - $columns[ $form_id . '_user_id' ] = 'user_id'; |
|
| 480 | - $columns[ $form_id . '_name' ] = 'name'; |
|
| 481 | - $columns[ $form_id . '_form_id' ] = 'form_id'; |
|
| 479 | + $columns[$form_id . '_user_id'] = 'user_id'; |
|
| 480 | + $columns[$form_id . '_name'] = 'name'; |
|
| 481 | + $columns[$form_id . '_form_id'] = 'form_id'; |
|
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | foreach ( $fields as $field ) { |
| 485 | 485 | if ( self::field_supports_sorting( $field ) ) { |
| 486 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
| 486 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | $atts['form_id'] . '_item_key' => '', |
| 581 | 581 | $atts['form_id'] . '_id' => '', |
| 582 | 582 | ); |
| 583 | - $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 583 | + $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 584 | 584 | |
| 585 | 585 | $i = $atts['i']; |
| 586 | 586 | |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | |
| 592 | 592 | if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) { |
| 593 | 593 | $result[] = $col_key; |
| 594 | - --$i; |
|
| 594 | + -- $i; |
|
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | 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 | |
@@ -788,17 +788,17 @@ discard block |
||
| 788 | 788 | */ |
| 789 | 789 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
| 790 | 790 | |
| 791 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
| 791 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
| 792 | 792 | |
| 793 | 793 | if ( empty( $errors ) ) { |
| 794 | 794 | $_POST['frm_skip_cookie'] = 1; |
| 795 | 795 | $do_success = false; |
| 796 | 796 | |
| 797 | 797 | if ( $params['action'] === 'create' ) { |
| 798 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
| 799 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 798 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
| 799 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 800 | 800 | |
| 801 | - $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id']; |
|
| 801 | + $params['id'] = $frm_vars['created_entries'][$form_id]['entry_id']; |
|
| 802 | 802 | $do_success = true; |
| 803 | 803 | } |
| 804 | 804 | } |
@@ -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 | ); |
@@ -227,9 +227,9 @@ discard block |
||
| 227 | 227 | $groups = FrmFormActionsController::form_action_groups(); |
| 228 | 228 | $group = 'misc'; |
| 229 | 229 | |
| 230 | - if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) { |
|
| 230 | + if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) { |
|
| 231 | 231 | $group = $action_options['group']; |
| 232 | - } elseif ( isset( $groups[ $this->id_base ] ) ) { |
|
| 232 | + } elseif ( isset( $groups[$this->id_base] ) ) { |
|
| 233 | 233 | $group = $this->id_base; |
| 234 | 234 | } else { |
| 235 | 235 | foreach ( $groups as $name => $check_group ) { |
@@ -240,8 +240,8 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - $groups[ $group ]['id'] = $group; |
|
| 244 | - return $groups[ $group ]; |
|
| 243 | + $groups[$group]['id'] = $group; |
|
| 244 | + return $groups[$group]; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | * @return int $post_id |
| 367 | 367 | */ |
| 368 | 368 | public function maybe_create_action( $action, $forms ) { |
| 369 | - if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] === 'updated' ) { |
|
| 369 | + if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] === 'updated' ) { |
|
| 370 | 370 | // Update action only |
| 371 | 371 | $action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] ); |
| 372 | 372 | return $this->save_settings( $action ); |
@@ -389,18 +389,18 @@ discard block |
||
| 389 | 389 | $switch = $this->get_global_switch_fields(); |
| 390 | 390 | |
| 391 | 391 | foreach ( (array) $action->post_content as $key => $val ) { |
| 392 | - if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) { |
|
| 393 | - $action->post_content[ $key ] = $frm_duplicate_ids[ $val ]; |
|
| 392 | + if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) { |
|
| 393 | + $action->post_content[$key] = $frm_duplicate_ids[$val]; |
|
| 394 | 394 | } elseif ( ! is_array( $val ) ) { |
| 395 | - $action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val ); |
|
| 396 | - } elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) { |
|
| 395 | + $action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val ); |
|
| 396 | + } elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) { |
|
| 397 | 397 | // loop through each value if empty |
| 398 | - if ( empty( $switch[ $key ] ) ) { |
|
| 399 | - $switch[ $key ] = array_keys( $val ); |
|
| 398 | + if ( empty( $switch[$key] ) ) { |
|
| 399 | + $switch[$key] = array_keys( $val ); |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | - foreach ( $switch[ $key ] as $subkey ) { |
|
| 403 | - $action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val ); |
|
| 402 | + foreach ( $switch[$key] as $subkey ) { |
|
| 403 | + $action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val ); |
|
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
@@ -425,20 +425,20 @@ discard block |
||
| 425 | 425 | foreach ( $subkey as $subkey2 ) { |
| 426 | 426 | foreach ( (array) $val as $ck => $cv ) { |
| 427 | 427 | if ( is_array( $cv ) ) { |
| 428 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv ); |
|
| 429 | - } elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) { |
|
| 430 | - $action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ]; |
|
| 428 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv ); |
|
| 429 | + } elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) { |
|
| 430 | + $action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]]; |
|
| 431 | 431 | } |
| 432 | 432 | } |
| 433 | 433 | } |
| 434 | 434 | } else { |
| 435 | 435 | foreach ( (array) $val as $ck => $cv ) { |
| 436 | 436 | if ( is_array( $cv ) ) { |
| 437 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv ); |
|
| 438 | - } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) { |
|
| 439 | - $action[ $ck ] = $frm_duplicate_ids[ $cv ]; |
|
| 437 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv ); |
|
| 438 | + } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) { |
|
| 439 | + $action[$ck] = $frm_duplicate_ids[$cv]; |
|
| 440 | 440 | } elseif ( $ck == $subkey ) { |
| 441 | - $action[ $ck ] = $this->maybe_switch_field_ids( $action[ $ck ] ); |
|
| 441 | + $action[$ck] = $this->maybe_switch_field_ids( $action[$ck] ); |
|
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | }//end if |
@@ -466,10 +466,10 @@ discard block |
||
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 469 | - if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) { |
|
| 469 | + if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) { |
|
| 470 | 470 | // Sanitizing removes scripts and <email> type of values. |
| 471 | 471 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 472 | - $settings = wp_unslash( $_POST[ $this->option_name ] ); |
|
| 472 | + $settings = wp_unslash( $_POST[$this->option_name] ); |
|
| 473 | 473 | } else { |
| 474 | 474 | return null; |
| 475 | 475 | } |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | foreach ( $settings as $number => $new_instance ) { |
| 480 | 480 | $this->_set( $number ); |
| 481 | 481 | |
| 482 | - $old_instance = $all_instances[ $number ] ?? array(); |
|
| 482 | + $old_instance = $all_instances[$number] ?? array(); |
|
| 483 | 483 | |
| 484 | 484 | if ( ! isset( $new_instance['post_status'] ) ) { |
| 485 | 485 | $new_instance['post_status'] = 'draft'; |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | $instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $instance['post_content'], $instance, $new_instance, $old_instance, $this ); |
| 519 | 519 | |
| 520 | 520 | if ( false !== $instance ) { |
| 521 | - $all_instances[ $number ] = $instance; |
|
| 521 | + $all_instances[$number] = $instance; |
|
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | $action_ids[] = $this->save_settings( $instance ); |
@@ -629,12 +629,12 @@ discard block |
||
| 629 | 629 | // some plugins/themes are formatting the post_excerpt |
| 630 | 630 | $action->post_excerpt = sanitize_title( $action->post_excerpt ); |
| 631 | 631 | |
| 632 | - if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) { |
|
| 632 | + if ( ! isset( $action_controls[$action->post_excerpt] ) ) { |
|
| 633 | 633 | continue; |
| 634 | 634 | } |
| 635 | 635 | |
| 636 | - $action = $action_controls[ $action->post_excerpt ]->prepare_action( $action ); |
|
| 637 | - $settings[ $action->ID ] = $action; |
|
| 636 | + $action = $action_controls[$action->post_excerpt]->prepare_action( $action ); |
|
| 637 | + $settings[$action->ID] = $action; |
|
| 638 | 638 | |
| 639 | 639 | if ( count( $settings ) >= $limit ) { |
| 640 | 640 | break; |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | * @return int The filtered limit value. |
| 661 | 661 | */ |
| 662 | 662 | public static function get_action_limit( $form_id, $limit = 99 ) { |
| 663 | - $type = 'all'; |
|
| 663 | + $type = 'all'; |
|
| 664 | 664 | return (int) apply_filters( 'frm_form_action_limit', (int) $limit, compact( 'type', 'form_id' ) ); |
| 665 | 665 | } |
| 666 | 666 | |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | 'limit' => 99, |
| 685 | 685 | 'post_status' => $default_status, |
| 686 | 686 | ); |
| 687 | - $args = wp_parse_args( $args, $defaults ); |
|
| 687 | + $args = wp_parse_args( $args, $defaults ); |
|
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | /** |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | |
| 765 | 765 | $action = $this->prepare_action( $action ); |
| 766 | 766 | |
| 767 | - $settings[ $action->ID ] = $action; |
|
| 767 | + $settings[$action->ID] = $action; |
|
| 768 | 768 | } |
| 769 | 769 | |
| 770 | 770 | if ( 1 === $limit ) { |
@@ -812,10 +812,10 @@ discard block |
||
| 812 | 812 | |
| 813 | 813 | foreach ( $default_values as $k => $vals ) { |
| 814 | 814 | if ( is_array( $vals ) && ! empty( $vals ) ) { |
| 815 | - if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) { |
|
| 815 | + if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) { |
|
| 816 | 816 | continue; |
| 817 | 817 | } |
| 818 | - $action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals ); |
|
| 818 | + $action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals ); |
|
| 819 | 819 | } |
| 820 | 820 | } |
| 821 | 821 | |
@@ -917,9 +917,9 @@ discard block |
||
| 917 | 917 | |
| 918 | 918 | // fill with existing options |
| 919 | 919 | foreach ( $action->post_content as $name => $val ) { |
| 920 | - if ( isset( $form->options[ $name ] ) ) { |
|
| 921 | - $action->post_content[ $name ] = $form->options[ $name ]; |
|
| 922 | - unset( $form->options[ $name ] ); |
|
| 920 | + if ( isset( $form->options[$name] ) ) { |
|
| 921 | + $action->post_content[$name] = $form->options[$name]; |
|
| 922 | + unset( $form->options[$name] ); |
|
| 923 | 923 | } |
| 924 | 924 | } |
| 925 | 925 | |
@@ -1027,7 +1027,7 @@ discard block |
||
| 1027 | 1027 | $form_fields = FrmField::get_all_for_form( $form_id, '', 'include' ); |
| 1028 | 1028 | return array_filter( |
| 1029 | 1029 | $form_fields, |
| 1030 | - function ( $form_field ) { |
|
| 1030 | + function( $form_field ) { |
|
| 1031 | 1031 | return ! FrmField::is_no_save_field( $form_field->type ); |
| 1032 | 1032 | } |
| 1033 | 1033 | ); |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | * @return array |
| 179 | 179 | */ |
| 180 | 180 | private function prepare_array_property( $index, $atts ) { |
| 181 | - if ( ! empty( $atts[ $index ] ) ) { |
|
| 182 | - return is_array( $atts[ $index ] ) ? $atts[ $index ] : explode( ',', $atts[ $index ] ); |
|
| 181 | + if ( ! empty( $atts[$index] ) ) { |
|
| 182 | + return is_array( $atts[$index] ) ? $atts[$index] : explode( ',', $atts[$index] ); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | return array(); |
@@ -256,11 +256,11 @@ discard block |
||
| 256 | 256 | ); |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - $ip = array( |
|
| 259 | + $ip = array( |
|
| 260 | 260 | 'label' => __( 'IP Address', 'formidable' ), |
| 261 | 261 | 'value' => $this->entry->ip, |
| 262 | 262 | ); |
| 263 | - $browser = array( |
|
| 263 | + $browser = array( |
|
| 264 | 264 | 'label' => __( 'User-Agent (Browser/OS)', 'formidable' ), |
| 265 | 265 | 'value' => isset( $entry_description['browser'] ) ? FrmEntriesHelper::get_browser( $entry_description['browser'] ) : '', |
| 266 | 266 | ); |
@@ -349,6 +349,6 @@ discard block |
||
| 349 | 349 | * @return void |
| 350 | 350 | */ |
| 351 | 351 | protected function add_field_values( $field ) { |
| 352 | - $this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry ); |
|
| 352 | + $this->field_values[$field->id] = new FrmFieldValue( $field, $this->entry ); |
|
| 353 | 353 | } |
| 354 | 354 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | 'class' => '', |
| 52 | 52 | 'inc_children' => 'exclude', |
| 53 | 53 | ); |
| 54 | - $args = wp_parse_args( $args, $defaults ); |
|
| 54 | + $args = wp_parse_args( $args, $defaults ); |
|
| 55 | 55 | |
| 56 | 56 | if ( ! $args['field_id'] ) { |
| 57 | 57 | $args['field_id'] = $field_name; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public static function add_html_attr( $class, $param, &$add_html ) { |
| 98 | 98 | if ( ! empty( $class ) ) { |
| 99 | - $add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 99 | + $add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
@@ -351,8 +351,8 @@ discard block |
||
| 351 | 351 | ); |
| 352 | 352 | |
| 353 | 353 | foreach ( $defaults as $var => $default ) { |
| 354 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 355 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 354 | + if ( ! isset( $values[$var] ) ) { |
|
| 355 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | |
@@ -368,8 +368,8 @@ discard block |
||
| 368 | 368 | ); |
| 369 | 369 | |
| 370 | 370 | foreach ( $defaults as $var => $default ) { |
| 371 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 372 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 371 | + if ( ! isset( $values[$var] ) ) { |
|
| 372 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | unset( $defaults ); |
@@ -420,16 +420,16 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | foreach ( $defaults as $var => $default ) { |
| 422 | 422 | if ( is_array( $default ) ) { |
| 423 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 424 | - $values[ $var ] = $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : array(); |
|
| 423 | + if ( ! isset( $values[$var] ) ) { |
|
| 424 | + $values[$var] = $record && isset( $record->options[$var] ) ? $record->options[$var] : array(); |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | foreach ( $default as $k => $v ) { |
| 428 | - $values[ $var ][ $k ] = $post_values && isset( $post_values[ $var ][ $k ] ) ? $post_values[ $var ][ $k ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ? $record->options[ $var ][ $k ] : $v ); |
|
| 428 | + $values[$var][$k] = $post_values && isset( $post_values[$var][$k] ) ? $post_values[$var][$k] : ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ? $record->options[$var][$k] : $v ); |
|
| 429 | 429 | |
| 430 | 430 | if ( is_array( $v ) ) { |
| 431 | 431 | foreach ( $v as $k1 => $v1 ) { |
| 432 | - $values[ $var ][ $k ][ $k1 ] = $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ? $post_values[ $var ][ $k ][ $k1 ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 ); |
|
| 432 | + $values[$var][$k][$k1] = $post_values && isset( $post_values[$var][$k][$k1] ) ? $post_values[$var][$k][$k1] : ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ? $record->options[$var][$k][$k1] : $v1 ); |
|
| 433 | 433 | unset( $k1, $v1 ); |
| 434 | 434 | } |
| 435 | 435 | } |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | unset( $k, $v ); |
| 438 | 438 | } |
| 439 | 439 | } else { |
| 440 | - $values[ $var ] = $post_values && isset( $post_values['options'][ $var ] ) ? $post_values['options'][ $var ] : ( $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : $default ); |
|
| 440 | + $values[$var] = $post_values && isset( $post_values['options'][$var] ) ? $post_values['options'][$var] : ( $record && isset( $record->options[$var] ) ? $record->options[$var] : $default ); |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | unset( $var, $default ); |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $defaults = self::get_default_opts(); |
| 487 | 487 | |
| 488 | 488 | foreach ( $defaults as $var => $default ) { |
| 489 | - $options[ $var ] = $values['options'][ $var ] ?? $default; |
|
| 489 | + $options[$var] = $values['options'][$var] ?? $default; |
|
| 490 | 490 | unset( $var, $default ); |
| 491 | 491 | } |
| 492 | 492 | } |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | public static function insert_opt_html( $args ) { |
| 684 | 684 | $class = $args['class'] ?? ''; |
| 685 | 685 | $fields = self::get_field_type_data_for_insert_opt_html(); |
| 686 | - $field = $fields[ $args['type'] ] ?? array(); |
|
| 686 | + $field = $fields[$args['type']] ?? array(); |
|
| 687 | 687 | |
| 688 | 688 | self::prepare_field_type( $field ); |
| 689 | 689 | |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | |
| 825 | 825 | foreach ( $fields as $field ) { |
| 826 | 826 | if ( $prev_order === $field->field_order ) { |
| 827 | - ++$add_order; |
|
| 827 | + ++ $add_order; |
|
| 828 | 828 | } |
| 829 | 829 | |
| 830 | 830 | if ( $add_order ) { |
@@ -1325,7 +1325,7 @@ discard block |
||
| 1325 | 1325 | return $data->name; |
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | - $form_id = $data; |
|
| 1328 | + $form_id = $data; |
|
| 1329 | 1329 | return FrmForm::getName( $form_id ); |
| 1330 | 1330 | } |
| 1331 | 1331 | |
@@ -1364,9 +1364,9 @@ discard block |
||
| 1364 | 1364 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
| 1365 | 1365 | } |
| 1366 | 1366 | |
| 1367 | - $label = ( $link_details[ $length ] ?? $link_details['label'] ); |
|
| 1367 | + $label = ( $link_details[$length] ?? $link_details['label'] ); |
|
| 1368 | 1368 | |
| 1369 | - if ( $length === 'icon' && isset( $link_details[ $length ] ) ) { |
|
| 1369 | + if ( $length === 'icon' && isset( $link_details[$length] ) ) { |
|
| 1370 | 1370 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
| 1371 | 1371 | $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
| 1372 | 1372 | } |
@@ -1534,7 +1534,7 @@ discard block |
||
| 1534 | 1534 | $status = 'publish'; |
| 1535 | 1535 | } |
| 1536 | 1536 | |
| 1537 | - return $nice_names[ $status ]; |
|
| 1537 | + return $nice_names[$status]; |
|
| 1538 | 1538 | } |
| 1539 | 1539 | |
| 1540 | 1540 | /** |
@@ -1598,7 +1598,7 @@ discard block |
||
| 1598 | 1598 | |
| 1599 | 1599 | if ( count( $categories ) === 1 ) { |
| 1600 | 1600 | $category = reset( $categories ); |
| 1601 | - $icon = $icons[ $category ] ?? $icon; |
|
| 1601 | + $icon = $icons[$category] ?? $icon; |
|
| 1602 | 1602 | } elseif ( ! empty( $categories ) ) { |
| 1603 | 1603 | $icons = array_intersect_key( $icons, array_flip( $categories ) ); |
| 1604 | 1604 | $icon = reset( $icons ); |
@@ -1730,7 +1730,7 @@ discard block |
||
| 1730 | 1730 | |
| 1731 | 1731 | foreach ( $item['categories'] as $k => $category ) { |
| 1732 | 1732 | if ( in_array( $category, $plans, true ) ) { |
| 1733 | - unset( $item['categories'][ $k ] ); |
|
| 1733 | + unset( $item['categories'][$k] ); |
|
| 1734 | 1734 | |
| 1735 | 1735 | return self::convert_legacy_package_names( $category ); |
| 1736 | 1736 | } |
@@ -1770,7 +1770,7 @@ discard block |
||
| 1770 | 1770 | 'include_all' => true, |
| 1771 | 1771 | 'case_lower' => false, |
| 1772 | 1772 | ); |
| 1773 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1773 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1774 | 1774 | |
| 1775 | 1775 | $license_types = array( 'Basic', 'Plus', 'Business', 'Elite' ); |
| 1776 | 1776 | |
@@ -1977,9 +1977,9 @@ discard block |
||
| 1977 | 1977 | } |
| 1978 | 1978 | |
| 1979 | 1979 | foreach ( $shortcodes[0] as $key => $shortcode ) { |
| 1980 | - $options = trim( $shortcodes[3][ $key ] ); |
|
| 1980 | + $options = trim( $shortcodes[3][$key] ); |
|
| 1981 | 1981 | |
| 1982 | - if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) { |
|
| 1982 | + if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) { |
|
| 1983 | 1983 | // Skip if shortcodes. |
| 1984 | 1984 | continue; |
| 1985 | 1985 | } |
@@ -1989,7 +1989,7 @@ discard block |
||
| 1989 | 1989 | continue; |
| 1990 | 1990 | } |
| 1991 | 1991 | |
| 1992 | - $new_shortcode = '[' . $shortcodes[2][ $key ]; |
|
| 1992 | + $new_shortcode = '[' . $shortcodes[2][$key]; |
|
| 1993 | 1993 | |
| 1994 | 1994 | if ( $options ) { |
| 1995 | 1995 | $new_shortcode .= ' ' . $options; |