@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | $groups = FrmFormActionsController::form_action_groups(); |
209 | 209 | $group = 'misc'; |
210 | 210 | |
211 | - if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) { |
|
211 | + if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) { |
|
212 | 212 | $group = $action_options['group']; |
213 | - } elseif ( isset( $groups[ $this->id_base ] ) ) { |
|
213 | + } elseif ( isset( $groups[$this->id_base] ) ) { |
|
214 | 214 | $group = $this->id_base; |
215 | 215 | } else { |
216 | 216 | foreach ( $groups as $name => $check_group ) { |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
224 | - $groups[ $group ]['id'] = $group; |
|
225 | - return $groups[ $group ]; |
|
224 | + $groups[$group]['id'] = $group; |
|
225 | + return $groups[$group]; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @return int $post_id |
334 | 334 | */ |
335 | 335 | public function maybe_create_action( $action, $forms ) { |
336 | - if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] === 'updated' ) { |
|
336 | + if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] === 'updated' ) { |
|
337 | 337 | // Update action only |
338 | 338 | $action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] ); |
339 | 339 | $post_id = $this->save_settings( $action ); |
@@ -356,18 +356,18 @@ discard block |
||
356 | 356 | $switch = $this->get_global_switch_fields(); |
357 | 357 | |
358 | 358 | foreach ( (array) $action->post_content as $key => $val ) { |
359 | - if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) { |
|
360 | - $action->post_content[ $key ] = $frm_duplicate_ids[ $val ]; |
|
359 | + if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) { |
|
360 | + $action->post_content[$key] = $frm_duplicate_ids[$val]; |
|
361 | 361 | } elseif ( ! is_array( $val ) ) { |
362 | - $action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val ); |
|
363 | - } elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) { |
|
362 | + $action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val ); |
|
363 | + } elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) { |
|
364 | 364 | // loop through each value if empty |
365 | - if ( empty( $switch[ $key ] ) ) { |
|
366 | - $switch[ $key ] = array_keys( $val ); |
|
365 | + if ( empty( $switch[$key] ) ) { |
|
366 | + $switch[$key] = array_keys( $val ); |
|
367 | 367 | } |
368 | 368 | |
369 | - foreach ( $switch[ $key ] as $subkey ) { |
|
370 | - $action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val ); |
|
369 | + foreach ( $switch[$key] as $subkey ) { |
|
370 | + $action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val ); |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | |
@@ -385,20 +385,20 @@ discard block |
||
385 | 385 | foreach ( $subkey as $subkey2 ) { |
386 | 386 | foreach ( (array) $val as $ck => $cv ) { |
387 | 387 | if ( is_array( $cv ) ) { |
388 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv ); |
|
389 | - } elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) { |
|
390 | - $action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ]; |
|
388 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv ); |
|
389 | + } elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) { |
|
390 | + $action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]]; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | } |
394 | 394 | } else { |
395 | 395 | foreach ( (array) $val as $ck => $cv ) { |
396 | 396 | if ( is_array( $cv ) ) { |
397 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv ); |
|
398 | - } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) { |
|
399 | - $action[ $ck ] = $frm_duplicate_ids[ $cv ]; |
|
397 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv ); |
|
398 | + } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) { |
|
399 | + $action[$ck] = $frm_duplicate_ids[$cv]; |
|
400 | 400 | } elseif ( $ck == $subkey ) { |
401 | - $action[ $ck ] = $this->maybe_switch_field_ids( $action[ $ck ] ); |
|
401 | + $action[$ck] = $this->maybe_switch_field_ids( $action[$ck] ); |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 | }//end if |
@@ -422,10 +422,10 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
425 | - if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) { |
|
425 | + if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) { |
|
426 | 426 | // Sanitizing removes scripts and <email> type of values. |
427 | 427 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
428 | - $settings = wp_unslash( $_POST[ $this->option_name ] ); |
|
428 | + $settings = wp_unslash( $_POST[$this->option_name] ); |
|
429 | 429 | } else { |
430 | 430 | return; |
431 | 431 | } |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | foreach ( $settings as $number => $new_instance ) { |
436 | 436 | $this->_set( $number ); |
437 | 437 | |
438 | - $old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array(); |
|
438 | + $old_instance = isset( $all_instances[$number] ) ? $all_instances[$number] : array(); |
|
439 | 439 | |
440 | 440 | if ( ! isset( $new_instance['post_status'] ) ) { |
441 | 441 | $new_instance['post_status'] = 'draft'; |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $instance['post_content'], $instance, $new_instance, $old_instance, $this ); |
475 | 475 | |
476 | 476 | if ( false !== $instance ) { |
477 | - $all_instances[ $number ] = $instance; |
|
477 | + $all_instances[$number] = $instance; |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | $action_ids[] = $this->save_settings( $instance ); |
@@ -560,12 +560,12 @@ discard block |
||
560 | 560 | // some plugins/themes are formatting the post_excerpt |
561 | 561 | $action->post_excerpt = sanitize_title( $action->post_excerpt ); |
562 | 562 | |
563 | - if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) { |
|
563 | + if ( ! isset( $action_controls[$action->post_excerpt] ) ) { |
|
564 | 564 | continue; |
565 | 565 | } |
566 | 566 | |
567 | - $action = $action_controls[ $action->post_excerpt ]->prepare_action( $action ); |
|
568 | - $settings[ $action->ID ] = $action; |
|
567 | + $action = $action_controls[$action->post_excerpt]->prepare_action( $action ); |
|
568 | + $settings[$action->ID] = $action; |
|
569 | 569 | |
570 | 570 | if ( count( $settings ) >= $limit ) { |
571 | 571 | break; |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | * @return int The filtered limit value. |
592 | 592 | */ |
593 | 593 | public static function get_action_limit( $form_id, $limit = 99 ) { |
594 | - $type = 'all'; |
|
594 | + $type = 'all'; |
|
595 | 595 | return (int) apply_filters( 'frm_form_action_limit', (int) $limit, compact( 'type', 'form_id' ) ); |
596 | 596 | } |
597 | 597 | |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | 'limit' => 99, |
615 | 615 | 'post_status' => $default_status, |
616 | 616 | ); |
617 | - $args = wp_parse_args( $args, $defaults ); |
|
617 | + $args = wp_parse_args( $args, $defaults ); |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | /** |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | |
685 | 685 | $action = $this->prepare_action( $action ); |
686 | 686 | |
687 | - $settings[ $action->ID ] = $action; |
|
687 | + $settings[$action->ID] = $action; |
|
688 | 688 | } |
689 | 689 | |
690 | 690 | if ( 1 === $limit ) { |
@@ -727,10 +727,10 @@ discard block |
||
727 | 727 | |
728 | 728 | foreach ( $default_values as $k => $vals ) { |
729 | 729 | if ( is_array( $vals ) && ! empty( $vals ) ) { |
730 | - if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) { |
|
730 | + if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) { |
|
731 | 731 | continue; |
732 | 732 | } |
733 | - $action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals ); |
|
733 | + $action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals ); |
|
734 | 734 | } |
735 | 735 | } |
736 | 736 | |
@@ -818,9 +818,9 @@ discard block |
||
818 | 818 | |
819 | 819 | // fill with existing options |
820 | 820 | foreach ( $action->post_content as $name => $val ) { |
821 | - if ( isset( $form->options[ $name ] ) ) { |
|
822 | - $action->post_content[ $name ] = $form->options[ $name ]; |
|
823 | - unset( $form->options[ $name ] ); |
|
821 | + if ( isset( $form->options[$name] ) ) { |
|
822 | + $action->post_content[$name] = $form->options[$name]; |
|
823 | + unset( $form->options[$name] ); |
|
824 | 824 | } |
825 | 825 | } |
826 | 826 | |
@@ -906,8 +906,8 @@ discard block |
||
906 | 906 | private static function get_value_from_entry( $entry, $field_id ) { |
907 | 907 | $observed_value = ''; |
908 | 908 | |
909 | - if ( isset( $entry->metas[ $field_id ] ) ) { |
|
910 | - $observed_value = $entry->metas[ $field_id ]; |
|
909 | + if ( isset( $entry->metas[$field_id] ) ) { |
|
910 | + $observed_value = $entry->metas[$field_id]; |
|
911 | 911 | } elseif ( $entry->post_id && FrmAppHelper::pro_is_installed() ) { |
912 | 912 | $field = FrmField::getOne( $field_id ); |
913 | 913 | $observed_value = FrmProEntryMetaHelper::get_post_or_meta_value( |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | $form_fields = FrmField::get_all_for_form( $form_id, '', 'include' ); |
982 | 982 | return array_filter( |
983 | 983 | $form_fields, |
984 | - function ( $form_field ) { |
|
984 | + function( $form_field ) { |
|
985 | 985 | return ! FrmField::is_no_save_field( $form_field->type ); |
986 | 986 | } |
987 | 987 | ); |
@@ -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 = isset( $info['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 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | ); |
127 | 127 | |
128 | 128 | foreach ( $skipped_keys as $skipped_key ) { |
129 | - unset( $data[ $skipped_key ] ); |
|
129 | + unset( $data[$skipped_key] ); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | return $data; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | |
225 | 225 | foreach ( $pass_settings as $setting ) { |
226 | 226 | if ( isset( $settings_list->$setting ) ) { |
227 | - $settings[ $setting ] = $this->maybe_json( $settings_list->$setting ); |
|
227 | + $settings[$setting] = $this->maybe_json( $settings_list->$setting ); |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | $message_settings = array(); |
262 | 262 | foreach ( $messages as $message ) { |
263 | - $message_settings[ 'changed-' . $message ] = $settings_list->$message === $default[ $message ] ? 0 : 1; |
|
263 | + $message_settings['changed-' . $message] = $settings_list->$message === $default[$message] ? 0 : 1; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | return $message_settings; |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
282 | 282 | if ( isset( $settings_list->$frm_role ) ) { |
283 | - $permissions[ $frm_role ] = $settings_list->$frm_role; |
|
283 | + $permissions[$frm_role] = $settings_list->$frm_role; |
|
284 | 284 | } |
285 | 285 | } |
286 | 286 | |
@@ -351,9 +351,9 @@ discard block |
||
351 | 351 | ); |
352 | 352 | |
353 | 353 | foreach ( $settings as $setting ) { |
354 | - if ( isset( $form->options[ $setting ] ) ) { |
|
354 | + if ( isset( $form->options[$setting] ) ) { |
|
355 | 355 | if ( 'custom_style' === $setting ) { |
356 | - $style->id = $form->options[ $setting ]; |
|
356 | + $style->id = $form->options[$setting]; |
|
357 | 357 | |
358 | 358 | if ( ! $style->id ) { |
359 | 359 | $style_name = 0; |
@@ -364,9 +364,9 @@ discard block |
||
364 | 364 | $style_name = $style_post ? $style_post->post_name : 'formidable-style'; |
365 | 365 | } |
366 | 366 | |
367 | - $new_form[ $setting ] = $style_name; |
|
367 | + $new_form[$setting] = $style_name; |
|
368 | 368 | } else { |
369 | - $new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] ); |
|
369 | + $new_form[$setting] = $this->maybe_json( $form->options[$setting] ); |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $fields = FrmDb::get_results( 'frm_fields', array(), 'id, form_id, name, type, field_options', $args ); |
427 | 427 | foreach ( $fields as $k => $field ) { |
428 | 428 | FrmAppHelper::unserialize_or_decode( $field->field_options ); |
429 | - $fields[ $k ]->field_options = json_encode( $field->field_options ); |
|
429 | + $fields[$k]->field_options = json_encode( $field->field_options ); |
|
430 | 430 | } |
431 | 431 | return $fields; |
432 | 432 | } |
@@ -160,7 +160,7 @@ |
||
160 | 160 | * @return object|string |
161 | 161 | */ |
162 | 162 | private static function post_to_connect_server( $action, $additional_body = array() ) { |
163 | - $body = array( |
|
163 | + $body = array( |
|
164 | 164 | 'frm_square_api_action' => $action, |
165 | 165 | 'frm_square_api_mode' => FrmSquareLiteAppHelper::active_mode(), |
166 | 166 | ); |
@@ -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 isset( $statuses[ $status ] ) ? $statuses[ $status ] : $status; |
|
69 | + return isset( $statuses[$status] ) ? $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 = isset( $settings[ $option ] ) ? $settings[ $option ] : ''; |
|
155 | + $value = isset( $settings[$option] ) ? $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 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | $form = $this->get_form(); |
52 | - return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ]; |
|
52 | + return ! empty( $form->options[$key] ) && 'off' !== $form->options[$key]; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | 'page' => '', |
46 | 46 | 'class' => 'frm-mt-0', |
47 | 47 | ); |
48 | - $tip = array_merge( $defaults, $tip ); |
|
48 | + $tip = array_merge( $defaults, $tip ); |
|
49 | 49 | |
50 | 50 | if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) { |
51 | 51 | $tip['link']['medium'] = 'tip'; |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | public static function get_random_tip( $tips ) { |
368 | 368 | $random = rand( 0, count( $tips ) - 1 ); |
369 | 369 | |
370 | - return $tips[ $random ]; |
|
370 | + return $tips[$random]; |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'default' => 'id', |
97 | 97 | ) |
98 | 98 | ); |
99 | - $order = self::get_param( |
|
99 | + $order = self::get_param( |
|
100 | 100 | array( |
101 | 101 | 'param' => 'order', |
102 | 102 | 'default' => 'DESC', |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $form_ids = $this->get_form_ids( $form_id ); |
149 | 149 | $s_query['it.form_id'] = count( $form_ids ) > 1 ? $form_ids : $form_ids[0]; |
150 | 150 | } else { |
151 | - $s_query[] = array( |
|
151 | + $s_query[] = array( |
|
152 | 152 | 'or' => 1, |
153 | 153 | 'parent_form_id' => null, |
154 | 154 | 'parent_form_id <' => 1, |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | |
316 | 316 | $r = "<tr id='item-action-{$item->id}'$style>"; |
317 | 317 | |
318 | - list( $columns, $hidden, , $primary ) = $this->get_column_info(); |
|
318 | + list( $columns, $hidden,, $primary ) = $this->get_column_info(); |
|
319 | 319 | $action_col = false; |
320 | 320 | $action_columns = $this->get_action_columns(); |
321 | 321 |
@@ -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 = isset( $form[ 'frmintent' . $form_id ] ) ? $form[ 'frmintent' . $form_id ] : array(); |
|
279 | + $intents = isset( $form['frmintent' . $form_id] ) ? $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 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | if ( $saved->metadata->action != $action->ID ) { |
341 | 341 | continue; |
342 | 342 | } |
343 | - $intents[ $k ] = array( |
|
343 | + $intents[$k] = array( |
|
344 | 344 | 'id' => $intent, |
345 | 345 | 'action' => $action->ID, |
346 | 346 | ); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | if ( $k === 'item_meta' ) { |
384 | 384 | foreach ( $v as $f => $value ) { |
385 | 385 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
386 | - $entry->metas[ absint( $f ) ] = $value; |
|
386 | + $entry->metas[absint( $f )] = $value; |
|
387 | 387 | } |
388 | 388 | } else { |
389 | 389 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -407,14 +407,14 @@ discard block |
||
407 | 407 | |
408 | 408 | foreach ( $form as $input ) { |
409 | 409 | $key = $input['name']; |
410 | - if ( isset( $formatted[ $key ] ) ) { |
|
411 | - if ( is_array( $formatted[ $key ] ) ) { |
|
412 | - $formatted[ $key ][] = $input['value']; |
|
410 | + if ( isset( $formatted[$key] ) ) { |
|
411 | + if ( is_array( $formatted[$key] ) ) { |
|
412 | + $formatted[$key][] = $input['value']; |
|
413 | 413 | } else { |
414 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
414 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
415 | 415 | } |
416 | 416 | } else { |
417 | - $formatted[ $key ] = $input['value']; |
|
417 | + $formatted[$key] = $input['value']; |
|
418 | 418 | } |
419 | 419 | } |
420 | 420 | |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | |
560 | 560 | foreach ( $actions as $k => $action ) { |
561 | 561 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
562 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
562 | + $actions[$k]->post_content['amount'] = $amount; |
|
563 | 563 | } |
564 | 564 | } |
565 | 565 |