@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | return $errors; |
15 | 15 | } |
16 | 16 | |
17 | - if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values[ 'frm_submit_entry_' . $values['form_id'] ] ) || ! wp_verify_nonce( $values[ 'frm_submit_entry_' . $values['form_id'] ], 'frm_submit_entry_nonce' ) ) ) { |
|
17 | + if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values['frm_submit_entry_' . $values['form_id']] ) || ! wp_verify_nonce( $values['frm_submit_entry_' . $values['form_id']], 'frm_submit_entry_nonce' ) ) ) { |
|
18 | 18 | $errors['form'] = __( 'You do not have permission to do that', 'formidable' ); |
19 | 19 | } |
20 | 20 | |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | 'key_pointer' => '', // the pointer in the posted array |
88 | 88 | 'exclude' => array(), // exclude these field types from validation |
89 | 89 | ); |
90 | - $args = wp_parse_args( $args, $defaults ); |
|
90 | + $args = wp_parse_args( $args, $defaults ); |
|
91 | 91 | |
92 | 92 | if ( empty( $args['parent_field_id'] ) ) { |
93 | - $value = isset( $values['item_meta'][ $args['id'] ] ) ? $values['item_meta'][ $args['id'] ] : ''; |
|
93 | + $value = isset( $values['item_meta'][$args['id']] ) ? $values['item_meta'][$args['id']] : ''; |
|
94 | 94 | } else { |
95 | 95 | // value is from a nested form |
96 | 96 | $value = $values; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) { |
114 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' ); |
|
114 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' ); |
|
115 | 115 | } elseif ( $posted_field->type === 'text' && ! isset( $_POST['item_name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
116 | 116 | $_POST['item_name'] = $value; |
117 | 117 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $pattern = self::phone_format( $field ); |
167 | 167 | |
168 | 168 | if ( ! preg_match( $pattern, $value ) ) { |
169 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' ); |
|
169 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $field, 'invalid' ); |
|
170 | 170 | } |
171 | 171 | } |
172 | 172 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | */ |
277 | 277 | private static function form_is_in_progress( $values ) { |
278 | 278 | return FrmAppHelper::pro_is_installed() && |
279 | - ( isset( $values[ 'frm_page_order_' . $values['form_id'] ] ) || FrmAppHelper::get_post_param( 'frm_next_page' ) ) && |
|
279 | + ( isset( $values['frm_page_order_' . $values['form_id']] ) || FrmAppHelper::get_post_param( 'frm_next_page' ) ) && |
|
280 | 280 | FrmField::get_all_types_in_form( $values['form_id'], 'break' ); |
281 | 281 | } |
282 | 282 | |
@@ -521,9 +521,9 @@ discard block |
||
521 | 521 | foreach ( $datas['missing_keys'] as $key_index => $key ) { |
522 | 522 | $found = self::is_akismet_guest_info_value( $key, $value, $field_id, $datas['name_field_ids'] ); |
523 | 523 | if ( $found ) { |
524 | - $datas[ $key ] = $value; |
|
524 | + $datas[$key] = $value; |
|
525 | 525 | $datas['frm_duplicated'][] = $field_id; |
526 | - unset( $datas['missing_keys'][ $key_index ] ); |
|
526 | + unset( $datas['missing_keys'][$key_index] ); |
|
527 | 527 | } |
528 | 528 | } |
529 | 529 | } |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | |
570 | 570 | // Send any potentially useful $_SERVER vars, but avoid sending junk we don't need. |
571 | 571 | if ( $include_value ) { |
572 | - $datas[ $key ] = $value; |
|
572 | + $datas[$key] = $value; |
|
573 | 573 | } |
574 | 574 | unset( $key, $value ); |
575 | 575 | } |
@@ -586,10 +586,10 @@ discard block |
||
586 | 586 | private static function add_comment_content_to_akismet( &$datas, $values ) { |
587 | 587 | if ( isset( $datas['frm_duplicated'] ) ) { |
588 | 588 | foreach ( $datas['frm_duplicated'] as $index ) { |
589 | - if ( isset( $values['item_meta'][ $index ] ) ) { |
|
590 | - unset( $values['item_meta'][ $index ] ); |
|
589 | + if ( isset( $values['item_meta'][$index] ) ) { |
|
590 | + unset( $values['item_meta'][$index] ); |
|
591 | 591 | } else { |
592 | - unset( $values[ $index ] ); |
|
592 | + unset( $values[$index] ); |
|
593 | 593 | } |
594 | 594 | } |
595 | 595 | unset( $datas['frm_duplicated'] ); |
@@ -610,8 +610,8 @@ discard block |
||
610 | 610 | private static function skip_adding_values_to_akismet( &$values ) { |
611 | 611 | $skipped_field_ids = self::get_akismet_skipped_field_ids( $values ); |
612 | 612 | foreach ( $skipped_field_ids as $field_id ) { |
613 | - if ( isset( $values['item_meta'][ $field_id ] ) ) { |
|
614 | - unset( $values['item_meta'][ $field_id ] ); |
|
613 | + if ( isset( $values['item_meta'][$field_id] ) ) { |
|
614 | + unset( $values['item_meta'][$field_id] ); |
|
615 | 615 | } |
616 | 616 | } |
617 | 617 | } |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | |
668 | 668 | // Convert name array to string. |
669 | 669 | if ( isset( $value['first'] ) && isset( $value['last'] ) ) { |
670 | - $values['item_meta'][ $field_id ] = trim( implode( ' ', $value ) ); |
|
670 | + $values['item_meta'][$field_id] = trim( implode( ' ', $value ) ); |
|
671 | 671 | $values['name_field_ids'][] = $field_id; |
672 | 672 | continue; |
673 | 673 | } |
@@ -688,8 +688,8 @@ discard block |
||
688 | 688 | continue; |
689 | 689 | } |
690 | 690 | |
691 | - if ( ! isset( $values['item_meta'][ $subsubindex ] ) ) { |
|
692 | - $values['item_meta'][ $subsubindex ] = array(); |
|
691 | + if ( ! isset( $values['item_meta'][$subsubindex] ) ) { |
|
692 | + $values['item_meta'][$subsubindex] = array(); |
|
693 | 693 | } |
694 | 694 | |
695 | 695 | // Convert name array to string. |
@@ -699,11 +699,11 @@ discard block |
||
699 | 699 | $values['name_field_ids'][] = $subsubindex; |
700 | 700 | } |
701 | 701 | |
702 | - $values['item_meta'][ $subsubindex ][] = $subsubvalue; |
|
702 | + $values['item_meta'][$subsubindex][] = $subsubvalue; |
|
703 | 703 | } |
704 | 704 | } |
705 | 705 | |
706 | - unset( $values['item_meta'][ $field_id ] ); |
|
706 | + unset( $values['item_meta'][$field_id] ); |
|
707 | 707 | } |
708 | 708 | |
709 | 709 | return $form_ids; |
@@ -112,7 +112,8 @@ discard block |
||
112 | 112 | |
113 | 113 | if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) { |
114 | 114 | $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' ); |
115 | - } elseif ( $posted_field->type === 'text' && ! isset( $_POST['item_name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
115 | + } elseif ( $posted_field->type === 'text' && ! isset( $_POST['item_name'] ) ) { |
|
116 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
116 | 117 | $_POST['item_name'] = $value; |
117 | 118 | } |
118 | 119 | |
@@ -678,7 +679,8 @@ discard block |
||
678 | 679 | // Blacklist check for File field in the old version doesn't contain `form_id`. |
679 | 680 | $form_ids = isset( $values['form_id'] ) ? array( absint( $values['form_id'] ) ) : array(); |
680 | 681 | foreach ( $values['item_meta'] as $field_id => $value ) { |
681 | - if ( ! is_numeric( $field_id ) ) { // Maybe `other`. |
|
682 | + if ( ! is_numeric( $field_id ) ) { |
|
683 | +// Maybe `other`. |
|
682 | 684 | continue; |
683 | 685 | } |
684 | 686 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | 'title' => esc_attr__( 'Toggle Options', 'formidable' ), |
17 | 17 | ) |
18 | 18 | ); |
19 | - $e_args = array( |
|
19 | + $e_args = array( |
|
20 | 20 | 'textarea_name' => 'field_options[description_' . absint( $field['id'] ) . ']', |
21 | 21 | 'textarea_rows' => 8, |
22 | 22 | ); |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | |
152 | 152 | if ( is_wp_error( $resp ) ) { |
153 | 153 | $error_string = $resp->get_error_message(); |
154 | - $errors[ 'field' . $args['id'] ] = __( 'There was a problem verifying your recaptcha', 'formidable' ); |
|
155 | - $errors[ 'field' . $args['id'] ] .= ' ' . $error_string; |
|
154 | + $errors['field' . $args['id']] = __( 'There was a problem verifying your recaptcha', 'formidable' ); |
|
155 | + $errors['field' . $args['id']] .= ' ' . $error_string; |
|
156 | 156 | return $errors; |
157 | 157 | } |
158 | 158 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | if ( isset( $response['success'] ) && ! $response['success'] ) { |
175 | 175 | // What happens when the CAPTCHA was entered incorrectly |
176 | 176 | $invalid_message = FrmField::get_option( $this->field, 'invalid' ); |
177 | - $errors[ 'field' . $args['id'] ] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message ); |
|
177 | + $errors['field' . $args['id']] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message ); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | return $errors; |
@@ -190,8 +190,8 @@ discard block |
||
190 | 190 | $frm_vars['captcha_scores'] = array(); |
191 | 191 | } |
192 | 192 | $form_id = is_object( $this->field ) ? $this->field->form_id : $this->field['form_id']; |
193 | - if ( ! isset( $frm_vars['captcha_scores'][ $form_id ] ) ) { |
|
194 | - $frm_vars['captcha_scores'][ $form_id ] = $score; |
|
193 | + if ( ! isset( $frm_vars['captcha_scores'][$form_id] ) ) { |
|
194 | + $frm_vars['captcha_scores'][$form_id] = $score; |
|
195 | 195 | } |
196 | 196 | } |
197 | 197 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $metas = FrmEntryMeta::get_entry_meta_info( $entry_exist ); |
81 | 81 | $field_metas = array(); |
82 | 82 | foreach ( $metas as $meta ) { |
83 | - $field_metas[ $meta->field_id ] = $meta->meta_value; |
|
83 | + $field_metas[$meta->field_id] = $meta->meta_value; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $filtered_vals = array_filter( $values['item_meta'] ); |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | $reduced = array(); |
137 | 137 | foreach ( $filter_vals as $field_id => $value ) { |
138 | 138 | $field = FrmFieldFactory::get_field_object( $field_id ); |
139 | - $reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
140 | - $reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] ); |
|
141 | - if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) { |
|
142 | - unset( $reduced[ $field_id ] ); |
|
139 | + $reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
140 | + $reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] ); |
|
141 | + if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) { |
|
142 | + unset( $reduced[$field_id] ); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | return $reduced; |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it |
333 | 333 | LEFT OUTER JOIN {$wpdb->prefix}frm_forms fr ON it.form_id=fr.id WHERE "; |
334 | 334 | |
335 | - $query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s'; |
|
335 | + $query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s'; |
|
336 | 336 | $query_args = array( $id ); |
337 | 337 | $query = $wpdb->prepare( $query, $query_args ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
338 | 338 | |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | private static function prepare_entries( &$entries ) { |
378 | 378 | foreach ( $entries as $k => $entry ) { |
379 | 379 | self::prepare_entry( $entry ); |
380 | - $entries[ $k ] = $entry; |
|
380 | + $entries[$k] = $entry; |
|
381 | 381 | } |
382 | 382 | } |
383 | 383 | |
@@ -402,20 +402,20 @@ discard block |
||
402 | 402 | foreach ( $metas as $meta_val ) { |
403 | 403 | if ( $meta_val->item_id == $entry->id ) { |
404 | 404 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
405 | - $entry->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
405 | + $entry->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
406 | 406 | if ( $include_key ) { |
407 | - $entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ]; |
|
407 | + $entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id]; |
|
408 | 408 | } |
409 | 409 | continue; |
410 | 410 | } |
411 | 411 | |
412 | 412 | // include sub entries in an array |
413 | - if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) { |
|
414 | - $entry->metas[ $meta_val->field_id ] = array(); |
|
413 | + if ( ! isset( $entry->metas[$meta_val->field_id] ) ) { |
|
414 | + $entry->metas[$meta_val->field_id] = array(); |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
418 | - $entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value; |
|
418 | + $entry->metas[$meta_val->field_id][] = $meta_val->meta_value; |
|
419 | 419 | |
420 | 420 | unset( $meta_val ); |
421 | 421 | } |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | |
463 | 463 | if ( $inc_form ) { |
464 | 464 | $fields = 'it.*, fr.name as form_name,fr.form_key as form_key'; |
465 | - $table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id '; |
|
465 | + $table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id '; |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | if ( preg_match( '/ meta_([0-9]+)/', $order_by, $order_matches ) ) { |
@@ -506,16 +506,16 @@ discard block |
||
506 | 506 | } |
507 | 507 | |
508 | 508 | foreach ( $metas as $m_key => $meta_val ) { |
509 | - if ( ! isset( $entries[ $meta_val->item_id ] ) ) { |
|
509 | + if ( ! isset( $entries[$meta_val->item_id] ) ) { |
|
510 | 510 | continue; |
511 | 511 | } |
512 | 512 | |
513 | - if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) { |
|
514 | - $entries[ $meta_val->item_id ]->metas = array(); |
|
513 | + if ( ! isset( $entries[$meta_val->item_id]->metas ) ) { |
|
514 | + $entries[$meta_val->item_id]->metas = array(); |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
518 | - $entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
518 | + $entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
519 | 519 | unset( $m_key, $meta_val ); |
520 | 520 | } |
521 | 521 | |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | } |
694 | 694 | |
695 | 695 | private static function get_entry_value( $values, $name, $default ) { |
696 | - return isset( $values[ $name ] ) ? $values[ $name ] : $default; |
|
696 | + return isset( $values[$name] ) ? $values[$name] : $default; |
|
697 | 697 | } |
698 | 698 | |
699 | 699 | /** |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | private static function maybe_add_captcha_meta( $form_id, $entry_id ) { |
875 | 875 | global $frm_vars; |
876 | 876 | if ( array_key_exists( 'captcha_scores', $frm_vars ) && array_key_exists( $form_id, $frm_vars['captcha_scores'] ) ) { |
877 | - $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][ $form_id ] ); |
|
877 | + $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][$form_id] ); |
|
878 | 878 | FrmEntryMeta::add_entry_meta( $entry_id, 0, '', maybe_serialize( $captcha_score_meta ) ); |
879 | 879 | } |
880 | 880 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | $data_keys = array_keys( $data ); |
7 | 7 | $params = array(); |
8 | 8 | foreach ( $data_keys as $key ) { |
9 | - $params[ 'data-' . $key ] = $data[ $key ]; |
|
9 | + $params['data-' . $key] = $data[$key]; |
|
10 | 10 | } |
11 | 11 | $params['class'] = 'frm_show_upgrade frm_noallow'; |
12 | 12 | $params['href'] = '#'; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'class' => '', |
29 | 29 | 'inc_children' => 'exclude', |
30 | 30 | ); |
31 | - $args = wp_parse_args( $args, $defaults ); |
|
31 | + $args = wp_parse_args( $args, $defaults ); |
|
32 | 32 | |
33 | 33 | if ( ! $args['field_id'] ) { |
34 | 34 | $args['field_id'] = $field_name; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public static function add_html_attr( $class, $param, &$add_html ) { |
72 | 72 | if ( ! empty( $class ) ) { |
73 | - $add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
73 | + $add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | 'description' => '', |
277 | 277 | ); |
278 | 278 | foreach ( $defaults as $var => $default ) { |
279 | - if ( ! isset( $values[ $var ] ) ) { |
|
280 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
279 | + if ( ! isset( $values[$var] ) ) { |
|
280 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | |
@@ -292,8 +292,8 @@ discard block |
||
292 | 292 | 'parent_form_id' => 0, |
293 | 293 | ); |
294 | 294 | foreach ( $defaults as $var => $default ) { |
295 | - if ( ! isset( $values[ $var ] ) ) { |
|
296 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
295 | + if ( ! isset( $values[$var] ) ) { |
|
296 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
297 | 297 | } |
298 | 298 | } |
299 | 299 | unset( $defaults ); |
@@ -330,16 +330,16 @@ discard block |
||
330 | 330 | $defaults = self::get_default_opts(); |
331 | 331 | foreach ( $defaults as $var => $default ) { |
332 | 332 | if ( is_array( $default ) ) { |
333 | - if ( ! isset( $values[ $var ] ) ) { |
|
334 | - $values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array(); |
|
333 | + if ( ! isset( $values[$var] ) ) { |
|
334 | + $values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array(); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | foreach ( $default as $k => $v ) { |
338 | - $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 ); |
|
338 | + $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 ); |
|
339 | 339 | |
340 | 340 | if ( is_array( $v ) ) { |
341 | 341 | foreach ( $v as $k1 => $v1 ) { |
342 | - $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 ); |
|
342 | + $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 ); |
|
343 | 343 | unset( $k1, $v1 ); |
344 | 344 | } |
345 | 345 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | unset( $k, $v ); |
348 | 348 | } |
349 | 349 | } else { |
350 | - $values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default ); |
|
350 | + $values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default ); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | unset( $var, $default ); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | public static function fill_form_options( &$options, $values ) { |
388 | 388 | $defaults = self::get_default_opts(); |
389 | 389 | foreach ( $defaults as $var => $default ) { |
390 | - $options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default; |
|
390 | + $options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default; |
|
391 | 391 | unset( $var, $default ); |
392 | 392 | } |
393 | 393 | } |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | public static function insert_opt_html( $args ) { |
550 | 550 | $class = isset( $args['class'] ) ? $args['class'] : ''; |
551 | 551 | $fields = FrmField::all_field_selection(); |
552 | - $field = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array(); |
|
552 | + $field = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array(); |
|
553 | 553 | |
554 | 554 | self::prepare_field_type( $field ); |
555 | 555 | |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) ); |
706 | 706 | } |
707 | 707 | |
708 | - $add_order += 2; |
|
708 | + $add_order += 2; |
|
709 | 709 | $open = false; |
710 | 710 | $reset_fields = true; |
711 | 711 | } |
@@ -1108,10 +1108,10 @@ discard block |
||
1108 | 1108 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
1109 | 1109 | } |
1110 | 1110 | |
1111 | - $label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] ); |
|
1112 | - if ( $length == 'icon' && isset( $link_details[ $length ] ) ) { |
|
1111 | + $label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] ); |
|
1112 | + if ( $length == 'icon' && isset( $link_details[$length] ) ) { |
|
1113 | 1113 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
1114 | - $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
1114 | + $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
1115 | 1115 | } |
1116 | 1116 | |
1117 | 1117 | $link .= '>' . $label . '</a>'; |
@@ -1250,7 +1250,7 @@ discard block |
||
1250 | 1250 | $status = 'publish'; |
1251 | 1251 | } |
1252 | 1252 | |
1253 | - $name = $nice_names[ $status ]; |
|
1253 | + $name = $nice_names[$status]; |
|
1254 | 1254 | |
1255 | 1255 | return $name; |
1256 | 1256 | } |
@@ -1283,17 +1283,17 @@ discard block |
||
1283 | 1283 | '' => array( 'align_right' ), |
1284 | 1284 | ); |
1285 | 1285 | |
1286 | - $icons[ __( 'My Templates', 'formidable' ) ] = array( 'user', 'var(--orange)' ); |
|
1286 | + $icons[__( 'My Templates', 'formidable' )] = array( 'user', 'var(--orange)' ); |
|
1287 | 1287 | |
1288 | 1288 | $icon = $icons['']; |
1289 | 1289 | |
1290 | 1290 | if ( count( $categories ) === 1 ) { |
1291 | 1291 | $category = reset( $categories ); |
1292 | - $icon = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon; |
|
1292 | + $icon = isset( $icons[$category] ) ? $icons[$category] : $icon; |
|
1293 | 1293 | } elseif ( ! empty( $categories ) ) { |
1294 | 1294 | foreach ( $icons as $cat => $icon ) { |
1295 | 1295 | if ( ! in_array( $cat, $categories ) ) { |
1296 | - unset( $icons[ $cat ] ); |
|
1296 | + unset( $icons[$cat] ); |
|
1297 | 1297 | } |
1298 | 1298 | } |
1299 | 1299 | $icon = reset( $icons ); |
@@ -1422,7 +1422,7 @@ discard block |
||
1422 | 1422 | |
1423 | 1423 | foreach ( $item['categories'] as $k => $category ) { |
1424 | 1424 | if ( in_array( $category, $plans, true ) ) { |
1425 | - unset( $item['categories'][ $k ] ); |
|
1425 | + unset( $item['categories'][$k] ); |
|
1426 | 1426 | |
1427 | 1427 | if ( in_array( $category, array( 'Creator', 'Personal' ), true ) ) { |
1428 | 1428 | // Show the current package name. |
@@ -1650,9 +1650,9 @@ discard block |
||
1650 | 1650 | } |
1651 | 1651 | |
1652 | 1652 | foreach ( $shortcodes[0] as $key => $shortcode ) { |
1653 | - $options = trim( $shortcodes[3][ $key ] ); |
|
1653 | + $options = trim( $shortcodes[3][$key] ); |
|
1654 | 1654 | |
1655 | - if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) { |
|
1655 | + if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) { |
|
1656 | 1656 | // Skip if shortcodes. |
1657 | 1657 | continue; |
1658 | 1658 | } |
@@ -1662,7 +1662,7 @@ discard block |
||
1662 | 1662 | continue; |
1663 | 1663 | } |
1664 | 1664 | |
1665 | - $new_shortcode = '[' . $shortcodes[2][ $key ]; |
|
1665 | + $new_shortcode = '[' . $shortcodes[2][$key]; |
|
1666 | 1666 | if ( $options ) { |
1667 | 1667 | $new_shortcode .= ' ' . $options; |
1668 | 1668 | } |
@@ -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 | ?> |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | <input |
62 | 62 | type="<?php echo esc_attr( $sub_field['type'] ); ?>" |
63 | 63 | id="<?php echo esc_attr( $html_id . '_' . $name ); ?>" |
64 | - value="<?php echo esc_attr( isset( $field_value[ $name ] ) ? $field_value[ $name ] : '' ); ?>" |
|
64 | + value="<?php echo esc_attr( isset( $field_value[$name] ) ? $field_value[$name] : '' ); ?>" |
|
65 | 65 | <?php |
66 | 66 | if ( empty( $args['remove_names'] ) ) { |
67 | 67 | echo 'name="' . esc_attr( $field_name ) . '[' . esc_attr( $name ) . ']" '; |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | // Don't show individual field errors when there is a combo field error. |
81 | - if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) { |
|
81 | + if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) { |
|
82 | 82 | ?> |
83 | - <div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div> |
|
83 | + <div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div> |
|
84 | 84 | <?php } ?> |
85 | 85 | </div> |
86 | 86 | <?php } ?> |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | * @param array $atts |
46 | 46 | */ |
47 | 47 | private function _set( $param, $atts ) { |
48 | - if ( isset( $atts[ $param ] ) ) { |
|
49 | - $this->{$param} = $atts[ $param ]; |
|
48 | + if ( isset( $atts[$param] ) ) { |
|
49 | + $this->{$param} = $atts[$param]; |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | |
91 | 91 | $exclude = array( 'field_obj', 'html' ); |
92 | 92 | foreach ( $exclude as $ex ) { |
93 | - if ( isset( $atts[ $ex ] ) ) { |
|
94 | - unset( $this->pass_args[ $ex ] ); |
|
93 | + if ( isset( $atts[$ex] ) ) { |
|
94 | + unset( $this->pass_args[$ex] ); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | } |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | * @param array $set |
104 | 104 | */ |
105 | 105 | private function set_from_field( $atts, $set ) { |
106 | - if ( isset( $atts[ $set['param'] ] ) ) { |
|
107 | - $this->{$set['param']} = $atts[ $set['param'] ]; |
|
106 | + if ( isset( $atts[$set['param']] ) ) { |
|
107 | + $this->{$set['param']} = $atts[$set['param']]; |
|
108 | 108 | } else { |
109 | 109 | $this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] ); |
110 | 110 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | private function replace_error_shortcode() { |
231 | 231 | $this->maybe_add_error_id(); |
232 | - $error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false; |
|
232 | + $error = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? $this->pass_args['errors']['field' . $this->field_id] : false; |
|
233 | 233 | |
234 | 234 | if ( ! empty( $error ) && false === strpos( $this->html, 'role="alert"' ) ) { |
235 | 235 | $error_body = self::get_error_body( $this->html ); |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | * @since 3.06.02 |
271 | 271 | */ |
272 | 272 | private function maybe_add_error_id() { |
273 | - if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
273 | + if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
274 | 274 | return; |
275 | 275 | } |
276 | 276 | |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER ); |
351 | 351 | |
352 | 352 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
353 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
353 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
354 | 354 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
355 | 355 | |
356 | 356 | $replace_with = ''; |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | $replace_with = $this->replace_input_shortcode( $shortcode_atts ); |
362 | 362 | } |
363 | 363 | |
364 | - $this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html ); |
|
364 | + $this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html ); |
|
365 | 365 | } |
366 | 366 | } |
367 | 367 | |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | unset( $shortcode_atts['class'] ); |
394 | 394 | } |
395 | 395 | |
396 | - $shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false'; |
|
396 | + $shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? 'true' : 'false'; |
|
397 | 397 | |
398 | 398 | $this->field_obj->set_field_column( 'shortcodes', $shortcode_atts ); |
399 | 399 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | */ |
449 | 449 | private function get_field_div_classes() { |
450 | 450 | // Add error class |
451 | - $classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : ''; |
|
451 | + $classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : ''; |
|
452 | 452 | |
453 | 453 | // Add label position class |
454 | 454 | $settings = $this->field_obj->display_field_settings(); |
@@ -443,11 +443,11 @@ discard block |
||
443 | 443 | ), |
444 | 444 | ); |
445 | 445 | |
446 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
446 | + if ( ! isset( $available_status[$status] ) ) { |
|
447 | 447 | return; |
448 | 448 | } |
449 | 449 | |
450 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
450 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
451 | 451 | |
452 | 452 | $params = FrmForm::list_page_params(); |
453 | 453 | |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | check_admin_referer( $status . '_form_' . $params['id'] ); |
456 | 456 | |
457 | 457 | $count = 0; |
458 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
458 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
459 | 459 | $count ++; |
460 | 460 | } |
461 | 461 | |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
473 | 473 | $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' ); |
474 | 474 | |
475 | - $message = $available_status[ $status ]['message']; |
|
475 | + $message = $available_status[$status]['message']; |
|
476 | 476 | |
477 | 477 | self::display_forms_list( $params, $message ); |
478 | 478 | } |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | 'type' => 'request', |
494 | 494 | ) |
495 | 495 | ); |
496 | - $message = sprintf( |
|
496 | + $message = sprintf( |
|
497 | 497 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
498 | 498 | _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), |
499 | 499 | $count, |
@@ -887,11 +887,11 @@ discard block |
||
887 | 887 | } |
888 | 888 | |
889 | 889 | foreach ( $template['categories'] as $category ) { |
890 | - if ( ! isset( $templates_by_category[ $category ] ) ) { |
|
891 | - $templates_by_category[ $category ] = array(); |
|
890 | + if ( ! isset( $templates_by_category[$category] ) ) { |
|
891 | + $templates_by_category[$category] = array(); |
|
892 | 892 | } |
893 | 893 | |
894 | - $templates_by_category[ $category ][] = $template; |
|
894 | + $templates_by_category[$category][] = $template; |
|
895 | 895 | } |
896 | 896 | } |
897 | 897 | unset( $template ); |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | $forms = FrmForm::get_published_forms( $where ); |
921 | 921 | $view_path = FrmAppHelper::plugin_path() . '/classes/views/frm-forms/'; |
922 | 922 | |
923 | - $templates_by_category[ $my_templates_translation ] = $custom_templates; |
|
923 | + $templates_by_category[$my_templates_translation] = $custom_templates; |
|
924 | 924 | |
925 | 925 | unset( $pricing, $license_type, $where ); |
926 | 926 | wp_enqueue_script( 'accordion' ); // register accordion for template groups |
@@ -1145,7 +1145,7 @@ discard block |
||
1145 | 1145 | |
1146 | 1146 | foreach ( array( 'landing', 'chat' ) as $feature ) { |
1147 | 1147 | if ( ! FrmAppHelper::show_new_feature( $feature ) ) { |
1148 | - unset( $sections[ $feature ] ); |
|
1148 | + unset( $sections[$feature] ); |
|
1149 | 1149 | } |
1150 | 1150 | } |
1151 | 1151 | |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | $section['id'] = $section['anchor']; |
1179 | 1179 | } |
1180 | 1180 | |
1181 | - $sections[ $key ] = $section; |
|
1181 | + $sections[$key] = $section; |
|
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | return $sections; |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | if ( ! empty( $user_fields ) ) { |
1282 | 1282 | $user_helpers = array(); |
1283 | 1283 | foreach ( $user_fields as $uk => $uf ) { |
1284 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
1284 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
1285 | 1285 | unset( $uk, $uf ); |
1286 | 1286 | } |
1287 | 1287 | |
@@ -1411,7 +1411,7 @@ discard block |
||
1411 | 1411 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
1412 | 1412 | $frm_vars['js_validate_forms'] = array(); |
1413 | 1413 | } |
1414 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
1414 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
1415 | 1415 | } |
1416 | 1416 | |
1417 | 1417 | public static function get_email_html() { |
@@ -1532,7 +1532,7 @@ discard block |
||
1532 | 1532 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
1533 | 1533 | } else { |
1534 | 1534 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
1535 | - $action = $vars[ $action ]; |
|
1535 | + $action = $vars[$action]; |
|
1536 | 1536 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1537 | 1537 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1538 | 1538 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -1658,7 +1658,7 @@ discard block |
||
1658 | 1658 | $actions = array(); |
1659 | 1659 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
1660 | 1660 | if ( is_object( $form ) ) { |
1661 | - $actions[ $form->id ] = $form->name; |
|
1661 | + $actions[$form->id] = $form->name; |
|
1662 | 1662 | } |
1663 | 1663 | unset( $form ); |
1664 | 1664 | } |
@@ -1867,8 +1867,8 @@ discard block |
||
1867 | 1867 | private static function get_saved_errors( $form, $params ) { |
1868 | 1868 | global $frm_vars; |
1869 | 1869 | |
1870 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1871 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
1870 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1871 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
1872 | 1872 | } else { |
1873 | 1873 | $errors = array(); |
1874 | 1874 | } |
@@ -1882,7 +1882,7 @@ discard block |
||
1882 | 1882 | public static function just_created_entry( $form_id ) { |
1883 | 1883 | global $frm_vars; |
1884 | 1884 | |
1885 | - return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0; |
|
1885 | + return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0; |
|
1886 | 1886 | } |
1887 | 1887 | |
1888 | 1888 | /** |
@@ -1890,7 +1890,7 @@ discard block |
||
1890 | 1890 | */ |
1891 | 1891 | private static function get_confirmation_method( $atts ) { |
1892 | 1892 | $opt = 'success_action'; |
1893 | - $method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message'; |
|
1893 | + $method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message'; |
|
1894 | 1894 | $method = apply_filters( 'frm_success_filter', $method, $atts['form'], 'create' ); |
1895 | 1895 | |
1896 | 1896 | if ( $method != 'message' && ( ! $atts['entry_id'] || ! is_numeric( $atts['entry_id'] ) ) ) { |
@@ -1903,7 +1903,7 @@ discard block |
||
1903 | 1903 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
1904 | 1904 | if ( ! isset( $params['id'] ) ) { |
1905 | 1905 | global $frm_vars; |
1906 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
1906 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
1907 | 1907 | } |
1908 | 1908 | |
1909 | 1909 | $conf_method = self::get_confirmation_method( |
@@ -1947,7 +1947,7 @@ discard block |
||
1947 | 1947 | $opt = ( ! isset( $args['action'] ) || $args['action'] === 'create' ) ? 'success' : 'edit'; |
1948 | 1948 | |
1949 | 1949 | $args['success_opt'] = $opt; |
1950 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
1950 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
1951 | 1951 | self::load_page_after_submit( $args ); |
1952 | 1952 | } elseif ( $args['conf_method'] === 'redirect' ) { |
1953 | 1953 | self::redirect_after_submit( $args ); |
@@ -1962,8 +1962,8 @@ discard block |
||
1962 | 1962 | private static function load_page_after_submit( $args ) { |
1963 | 1963 | global $post; |
1964 | 1964 | $opt = $args['success_opt']; |
1965 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
1966 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
1965 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
1966 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
1967 | 1967 | $old_post = $post; |
1968 | 1968 | $post = $page; |
1969 | 1969 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -1981,11 +1981,11 @@ discard block |
||
1981 | 1981 | add_filter( 'frm_use_wpautop', '__return_false' ); |
1982 | 1982 | |
1983 | 1983 | $opt = $args['success_opt']; |
1984 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
1984 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
1985 | 1985 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
1986 | 1986 | $success_url = do_shortcode( $success_url ); |
1987 | 1987 | |
1988 | - $success_msg = isset( $args['form']->options[ $opt . '_msg' ] ) ? $args['form']->options[ $opt . '_msg' ] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
1988 | + $success_msg = isset( $args['form']->options[$opt . '_msg'] ) ? $args['form']->options[$opt . '_msg'] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
1989 | 1989 | |
1990 | 1990 | $redirect_msg = self::get_redirect_message( $success_url, $success_msg, $args ); |
1991 | 1991 | |
@@ -2122,7 +2122,7 @@ discard block |
||
2122 | 2122 | 'description' => false, |
2123 | 2123 | 'reset' => false, |
2124 | 2124 | ); |
2125 | - $args = wp_parse_args( $args, $defaults ); |
|
2125 | + $args = wp_parse_args( $args, $defaults ); |
|
2126 | 2126 | } |
2127 | 2127 | |
2128 | 2128 | /** |
@@ -2338,7 +2338,7 @@ discard block |
||
2338 | 2338 | |
2339 | 2339 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
2340 | 2340 | |
2341 | - $html = FrmAppHelper::clip( |
|
2341 | + $html = FrmAppHelper::clip( |
|
2342 | 2342 | function() { |
2343 | 2343 | FrmAppHelper::maybe_autocomplete_pages_options( |
2344 | 2344 | array( |
@@ -1520,7 +1520,8 @@ discard block |
||
1520 | 1520 | $vars = array(); |
1521 | 1521 | FrmAppHelper::include_svg(); |
1522 | 1522 | |
1523 | - if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1523 | + if ( isset( $_POST['frm_compact_fields'] ) ) { |
|
1524 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1524 | 1525 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
1525 | 1526 | |
1526 | 1527 | // Javascript needs to be allowed in some field settings. |
@@ -1828,7 +1829,8 @@ discard block |
||
1828 | 1829 | private static function maybe_get_form_to_show( $id ) { |
1829 | 1830 | $form = false; |
1830 | 1831 | |
1831 | - if ( ! empty( $id ) ) { // form id or key is set |
|
1832 | + if ( ! empty( $id ) ) { |
|
1833 | +// form id or key is set |
|
1832 | 1834 | $form = FrmForm::getOne( $id ); |
1833 | 1835 | if ( ! $form || $form->parent_form_id || $form->status === 'trash' ) { |
1834 | 1836 | $form = false; |
@@ -1910,7 +1912,8 @@ discard block |
||
1910 | 1912 | private static function get_saved_errors( $form, $params ) { |
1911 | 1913 | global $frm_vars; |
1912 | 1914 | |
1913 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1915 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
1916 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1914 | 1917 | $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
1915 | 1918 | } else { |
1916 | 1919 | $errors = array(); |