@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | $field_val = ''; |
145 | 145 | if ( is_object( $this->field ) ) { |
146 | 146 | $field_val = $this->field->{$column}; |
147 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
148 | - $field_val = $this->field[ $column ]; |
|
147 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
148 | + $field_val = $this->field[$column]; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | return $field_val; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | if ( is_object( $this->field ) ) { |
160 | 160 | $this->field->{$column} = $value; |
161 | 161 | } elseif ( is_array( $this->field ) ) { |
162 | - $this->field[ $column ] = $value; |
|
162 | + $this->field[$column] = $value; |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | printf( |
549 | 549 | /* translators: %s: Field type */ |
550 | 550 | esc_html__( '%s Options', 'formidable' ), |
551 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
551 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
552 | 552 | ); |
553 | 553 | FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); |
554 | 554 | ?> |
@@ -681,8 +681,8 @@ discard block |
||
681 | 681 | |
682 | 682 | $fields = array_merge( $fields, $pro_fields ); |
683 | 683 | |
684 | - if ( isset( $fields[ $this->type ] ) ) { |
|
685 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
684 | + if ( isset( $fields[$this->type] ) ) { |
|
685 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
686 | 686 | } |
687 | 687 | |
688 | 688 | return $name; |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | * @return array |
700 | 700 | */ |
701 | 701 | public function get_default_field_options() { |
702 | - $opts = array( |
|
702 | + $opts = array( |
|
703 | 703 | 'size' => '', |
704 | 704 | 'max' => '', |
705 | 705 | 'label' => '', |
@@ -1066,7 +1066,7 @@ discard block |
||
1066 | 1066 | } |
1067 | 1067 | } else { |
1068 | 1068 | $args['save_array'] = $this->is_readonly_array(); |
1069 | - $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
1069 | + $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
1070 | 1070 | } |
1071 | 1071 | |
1072 | 1072 | return $hidden; |
@@ -1075,7 +1075,7 @@ discard block |
||
1075 | 1075 | protected function show_single_hidden( $selected, $args ) { |
1076 | 1076 | if ( $args['save_array'] ) { |
1077 | 1077 | $args['field_name'] .= '[]'; |
1078 | - $id = ''; |
|
1078 | + $id = ''; |
|
1079 | 1079 | } else { |
1080 | 1080 | $id = ' id="' . esc_attr( $args['html_id'] ) . '"'; |
1081 | 1081 | } |
@@ -1091,8 +1091,8 @@ discard block |
||
1091 | 1091 | $selected = $values['field_value']; |
1092 | 1092 | |
1093 | 1093 | if ( isset( $values['combo_name'] ) ) { |
1094 | - $options = $options[ $values['combo_name'] ]; |
|
1095 | - $selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : ''; |
|
1094 | + $options = $options[$values['combo_name']]; |
|
1095 | + $selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : ''; |
|
1096 | 1096 | } |
1097 | 1097 | |
1098 | 1098 | $input = $this->select_tag( $values ); |
@@ -1143,7 +1143,7 @@ discard block |
||
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | protected function fill_display_field_values( $args = array() ) { |
1146 | - $defaults = array( |
|
1146 | + $defaults = array( |
|
1147 | 1147 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
1148 | 1148 | 'field_id' => $this->get_field_column( 'id' ), |
1149 | 1149 | 'field_plus_id' => '', |
@@ -1196,7 +1196,7 @@ discard block |
||
1196 | 1196 | } |
1197 | 1197 | } |
1198 | 1198 | |
1199 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
1199 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
1200 | 1200 | if ( $error_comes_first ) { |
1201 | 1201 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
1202 | 1202 | } else { |
@@ -1275,11 +1275,11 @@ discard block |
||
1275 | 1275 | |
1276 | 1276 | $field_id = $this->get_field_column( 'id' ); |
1277 | 1277 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
1278 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
1278 | + $frm_validated_unique_values[$field_id] = array(); |
|
1279 | 1279 | return false; |
1280 | 1280 | } |
1281 | 1281 | |
1282 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
1282 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
1283 | 1283 | return $already_validated_this_value; |
1284 | 1284 | } |
1285 | 1285 | |
@@ -1304,7 +1304,7 @@ discard block |
||
1304 | 1304 | private function value_validated_as_unique( $value ) { |
1305 | 1305 | global $frm_validated_unique_values; |
1306 | 1306 | $field_id = $this->get_field_column( 'id' ); |
1307 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
1307 | + $frm_validated_unique_values[$field_id][] = $value; |
|
1308 | 1308 | } |
1309 | 1309 | |
1310 | 1310 | public function get_value_to_save( $value, $atts ) { |
@@ -1336,8 +1336,8 @@ discard block |
||
1336 | 1336 | $value = $this->prepare_display_value( $value, $atts ); |
1337 | 1337 | |
1338 | 1338 | if ( is_array( $value ) ) { |
1339 | - if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) { |
|
1340 | - $value = $value[ $atts['show'] ]; |
|
1339 | + if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) { |
|
1340 | + $value = $value[$atts['show']]; |
|
1341 | 1341 | } elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) { |
1342 | 1342 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
1343 | 1343 | $value = implode( $sep, $value ); |
@@ -1406,8 +1406,8 @@ discard block |
||
1406 | 1406 | $saved_entries = $atts['ids']; |
1407 | 1407 | $new_value = array(); |
1408 | 1408 | foreach ( (array) $value as $old_child_id ) { |
1409 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
1410 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
1409 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
1410 | + $new_value[] = $saved_entries[$old_child_id]; |
|
1411 | 1411 | } |
1412 | 1412 | } |
1413 | 1413 |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | 'fill' => '#4d4d4d', |
179 | 179 | 'orange' => '#f05a24', |
180 | 180 | ); |
181 | - $atts = array_merge( $defaults, $atts ); |
|
181 | + $atts = array_merge( $defaults, $atts ); |
|
182 | 182 | |
183 | 183 | return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.68 601.37" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '"> |
184 | 184 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | * @return string |
390 | 390 | */ |
391 | 391 | public static function get_server_value( $value ) { |
392 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
392 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | /** |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | $ip = ''; |
425 | 425 | |
426 | 426 | foreach ( $ip_options as $key ) { |
427 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
427 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
428 | 428 | continue; |
429 | 429 | } |
430 | 430 | |
@@ -492,10 +492,10 @@ discard block |
||
492 | 492 | } |
493 | 493 | |
494 | 494 | if ( $src === 'get' ) { |
495 | - $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
|
496 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
495 | + $value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
|
496 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
497 | 497 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
498 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
498 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
499 | 499 | } |
500 | 500 | self::sanitize_value( $sanitize, $value ); |
501 | 501 | } else { |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | } |
517 | 517 | |
518 | 518 | $p = trim( $p, ']' ); |
519 | - $value = isset( $value[ $p ] ) ? $value[ $p ] : $default; |
|
519 | + $value = isset( $value[$p] ) ? $value[$p] : $default; |
|
520 | 520 | } |
521 | 521 | } |
522 | 522 | |
@@ -572,26 +572,26 @@ discard block |
||
572 | 572 | 'sanitize' => 'sanitize_text_field', |
573 | 573 | 'serialized' => false, |
574 | 574 | ); |
575 | - $args = wp_parse_args( $args, $defaults ); |
|
575 | + $args = wp_parse_args( $args, $defaults ); |
|
576 | 576 | |
577 | 577 | $value = $args['default']; |
578 | 578 | if ( $args['type'] === 'get' ) { |
579 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
579 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
580 | 580 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
581 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
581 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
582 | 582 | } |
583 | 583 | } elseif ( $args['type'] === 'post' ) { |
584 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
584 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
585 | 585 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
586 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
586 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
587 | 587 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
588 | 588 | self::unserialize_or_decode( $value ); |
589 | 589 | } |
590 | 590 | } |
591 | 591 | } else { |
592 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
592 | + if ( isset( $_REQUEST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
593 | 593 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
594 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
594 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
595 | 595 | } |
596 | 596 | } |
597 | 597 | |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | if ( is_array( $value ) ) { |
624 | 624 | $temp_values = $value; |
625 | 625 | foreach ( $temp_values as $k => $v ) { |
626 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
626 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
627 | 627 | } |
628 | 628 | } else { |
629 | 629 | $value = call_user_func( $sanitize, $value ); |
@@ -634,8 +634,8 @@ discard block |
||
634 | 634 | public static function sanitize_request( $sanitize_method, &$values ) { |
635 | 635 | $temp_values = $values; |
636 | 636 | foreach ( $temp_values as $k => $val ) { |
637 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
638 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
637 | + if ( isset( $sanitize_method[$k] ) ) { |
|
638 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
639 | 639 | } |
640 | 640 | } |
641 | 641 | } |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | if ( is_array( $value ) ) { |
659 | 659 | $temp_values = $value; |
660 | 660 | foreach ( $temp_values as $k => $v ) { |
661 | - self::decode_specialchars( $value[ $k ] ); |
|
661 | + self::decode_specialchars( $value[$k] ); |
|
662 | 662 | } |
663 | 663 | } else { |
664 | 664 | self::decode_amp( $value ); |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | * @return array |
779 | 779 | */ |
780 | 780 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
781 | - $allowed_html['input'] = array( |
|
781 | + $allowed_html['input'] = array( |
|
782 | 782 | 'type' => true, |
783 | 783 | 'value' => true, |
784 | 784 | 'formnovalidate' => true, |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | $allowed_html = $html; |
802 | 802 | } elseif ( ! empty( $allowed ) ) { |
803 | 803 | foreach ( (array) $allowed as $a ) { |
804 | - $allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array(); |
|
804 | + $allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array(); |
|
805 | 805 | } |
806 | 806 | } |
807 | 807 | |
@@ -980,8 +980,8 @@ discard block |
||
980 | 980 | } |
981 | 981 | |
982 | 982 | global $wp_query; |
983 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
984 | - $value = $wp_query->query_vars[ $param ]; |
|
983 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
984 | + $value = $wp_query->query_vars[$param]; |
|
985 | 985 | } |
986 | 986 | |
987 | 987 | return $value; |
@@ -1008,9 +1008,9 @@ discard block |
||
1008 | 1008 | $deprecated = array( |
1009 | 1009 | 'frm_clone_solid_icon' => 'frm_clone_icon', |
1010 | 1010 | ); |
1011 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
1012 | - $icon = $deprecated[ $icon ]; |
|
1013 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
1011 | + if ( isset( $deprecated[$icon] ) ) { |
|
1012 | + $icon = $deprecated[$icon]; |
|
1013 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
1014 | 1014 | } |
1015 | 1015 | |
1016 | 1016 | if ( $icon === $class ) { |
@@ -1338,7 +1338,7 @@ discard block |
||
1338 | 1338 | 'new_file_path' => self::plugin_path() . '/js', |
1339 | 1339 | ) |
1340 | 1340 | ); |
1341 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1341 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1342 | 1342 | |
1343 | 1343 | $files = array( |
1344 | 1344 | self::plugin_path() . '/js/formidable.min.js', |
@@ -1357,7 +1357,7 @@ discard block |
||
1357 | 1357 | 'new_file_path' => self::plugin_path() . '/js', |
1358 | 1358 | ) |
1359 | 1359 | ); |
1360 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1360 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1361 | 1361 | $files = array( |
1362 | 1362 | FrmStrpLiteAppHelper::plugin_path() . 'js/frmstrp.min.js', |
1363 | 1363 | ); |
@@ -1842,8 +1842,8 @@ discard block |
||
1842 | 1842 | return $error; |
1843 | 1843 | } |
1844 | 1844 | |
1845 | - $nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
1846 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1845 | + $nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
1846 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1847 | 1847 | $frm_settings = self::get_settings(); |
1848 | 1848 | $error = $frm_settings->admin_permission; |
1849 | 1849 | } |
@@ -1878,7 +1878,7 @@ discard block |
||
1878 | 1878 | } else { |
1879 | 1879 | foreach ( $value as $k => $v ) { |
1880 | 1880 | if ( ! is_array( $v ) ) { |
1881 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
1881 | + $value[$k] = call_user_func( $original_function, $v ); |
|
1882 | 1882 | } |
1883 | 1883 | } |
1884 | 1884 | } |
@@ -1903,7 +1903,7 @@ discard block |
||
1903 | 1903 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
1904 | 1904 | } else { |
1905 | 1905 | if ( $keys === 'keep' ) { |
1906 | - $return[ $key ] = $value; |
|
1906 | + $return[$key] = $value; |
|
1907 | 1907 | } else { |
1908 | 1908 | $return[] = $value; |
1909 | 1909 | } |
@@ -1956,11 +1956,11 @@ discard block |
||
1956 | 1956 | } |
1957 | 1957 | |
1958 | 1958 | $ver = $default; |
1959 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
1959 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
1960 | 1960 | return $ver; |
1961 | 1961 | } |
1962 | 1962 | |
1963 | - $query = $wp_scripts->registered[ $handle ]; |
|
1963 | + $query = $wp_scripts->registered[$handle]; |
|
1964 | 1964 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
1965 | 1965 | $ver = $query->ver; |
1966 | 1966 | } |
@@ -2066,7 +2066,7 @@ discard block |
||
2066 | 2066 | $suffix = 2; |
2067 | 2067 | do { |
2068 | 2068 | $key_check = $key . $separator . $suffix; |
2069 | - ++$suffix; |
|
2069 | + ++ $suffix; |
|
2070 | 2070 | } while ( in_array( $key_check, $similar_keys, true ) ); |
2071 | 2071 | |
2072 | 2072 | $key = $key_check; |
@@ -2167,7 +2167,7 @@ discard block |
||
2167 | 2167 | |
2168 | 2168 | foreach ( array( 'name', 'description' ) as $var ) { |
2169 | 2169 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
2170 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2170 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2171 | 2171 | unset( $var, $default_val ); |
2172 | 2172 | } |
2173 | 2173 | |
@@ -2225,9 +2225,9 @@ discard block |
||
2225 | 2225 | } |
2226 | 2226 | } |
2227 | 2227 | |
2228 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
2229 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
2230 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
2228 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
2229 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
2230 | + $new_value = $post_values['item_meta'][$field->id]; |
|
2231 | 2231 | self::unserialize_or_decode( $new_value ); |
2232 | 2232 | } else { |
2233 | 2233 | $new_value = $meta_value; |
@@ -2248,7 +2248,7 @@ discard block |
||
2248 | 2248 | |
2249 | 2249 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
2250 | 2250 | |
2251 | - $values['fields'][ $field->id ] = $field_array; |
|
2251 | + $values['fields'][$field->id] = $field_array; |
|
2252 | 2252 | } |
2253 | 2253 | |
2254 | 2254 | /** |
@@ -2295,11 +2295,11 @@ discard block |
||
2295 | 2295 | } |
2296 | 2296 | |
2297 | 2297 | foreach ( $form->options as $opt => $value ) { |
2298 | - if ( isset( $post_values[ $opt ] ) ) { |
|
2299 | - $values[ $opt ] = $post_values[ $opt ]; |
|
2300 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
2298 | + if ( isset( $post_values[$opt] ) ) { |
|
2299 | + $values[$opt] = $post_values[$opt]; |
|
2300 | + self::unserialize_or_decode( $values[$opt] ); |
|
2301 | 2301 | } else { |
2302 | - $values[ $opt ] = $value; |
|
2302 | + $values[$opt] = $value; |
|
2303 | 2303 | } |
2304 | 2304 | } |
2305 | 2305 | |
@@ -2313,8 +2313,8 @@ discard block |
||
2313 | 2313 | $form_defaults = FrmFormsHelper::get_default_opts(); |
2314 | 2314 | |
2315 | 2315 | foreach ( $form_defaults as $opt => $default ) { |
2316 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
2317 | - $values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default; |
|
2316 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
2317 | + $values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default; |
|
2318 | 2318 | } |
2319 | 2319 | |
2320 | 2320 | unset( $opt, $default ); |
@@ -2325,8 +2325,8 @@ discard block |
||
2325 | 2325 | } |
2326 | 2326 | |
2327 | 2327 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
2328 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
2329 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
2328 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
2329 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
2330 | 2330 | } |
2331 | 2331 | unset( $h ); |
2332 | 2332 | } |
@@ -2478,25 +2478,25 @@ discard block |
||
2478 | 2478 | if ( ! is_numeric( $levels ) ) { |
2479 | 2479 | // Show time in specified unit. |
2480 | 2480 | $levels = self::get_unit( $levels ); |
2481 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
2481 | + if ( isset( $time_strings[$levels] ) ) { |
|
2482 | 2482 | $diff = array( |
2483 | 2483 | $levels => self::time_format( $levels, $diff ), |
2484 | 2484 | ); |
2485 | 2485 | $time_strings = array( |
2486 | - $levels => $time_strings[ $levels ], |
|
2486 | + $levels => $time_strings[$levels], |
|
2487 | 2487 | ); |
2488 | 2488 | } |
2489 | 2489 | $levels = 1; |
2490 | 2490 | } |
2491 | 2491 | |
2492 | 2492 | foreach ( $time_strings as $k => $v ) { |
2493 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
2494 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
2495 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
2493 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
2494 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
2495 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
2496 | 2496 | // Account for 0. |
2497 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
2497 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
2498 | 2498 | } else { |
2499 | - unset( $time_strings[ $k ] ); |
|
2499 | + unset( $time_strings[$k] ); |
|
2500 | 2500 | } |
2501 | 2501 | } |
2502 | 2502 | |
@@ -2515,8 +2515,8 @@ discard block |
||
2515 | 2515 | 'y' => 'y', |
2516 | 2516 | 'd' => 'days', |
2517 | 2517 | ); |
2518 | - if ( isset( $return[ $unit ] ) ) { |
|
2519 | - return $diff[ $return[ $unit ] ]; |
|
2518 | + if ( isset( $return[$unit] ) ) { |
|
2519 | + return $diff[$return[$unit]]; |
|
2520 | 2520 | } |
2521 | 2521 | |
2522 | 2522 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -2524,11 +2524,11 @@ discard block |
||
2524 | 2524 | $times = array( 'h', 'i', 's' ); |
2525 | 2525 | |
2526 | 2526 | foreach ( $times as $time ) { |
2527 | - if ( ! isset( $diff[ $time ] ) ) { |
|
2527 | + if ( ! isset( $diff[$time] ) ) { |
|
2528 | 2528 | continue; |
2529 | 2529 | } |
2530 | 2530 | |
2531 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
2531 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
2532 | 2532 | } |
2533 | 2533 | |
2534 | 2534 | return floor( $total ); |
@@ -2548,7 +2548,7 @@ discard block |
||
2548 | 2548 | 'y' => DAY_IN_SECONDS * 365.25, |
2549 | 2549 | ); |
2550 | 2550 | |
2551 | - return $convert[ $from ] / $convert[ $to ]; |
|
2551 | + return $convert[$from] / $convert[$to]; |
|
2552 | 2552 | } |
2553 | 2553 | |
2554 | 2554 | /** |
@@ -2556,7 +2556,7 @@ discard block |
||
2556 | 2556 | */ |
2557 | 2557 | private static function get_unit( $unit ) { |
2558 | 2558 | $units = self::get_time_strings(); |
2559 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
2559 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
2560 | 2560 | return $unit; |
2561 | 2561 | } |
2562 | 2562 | |
@@ -2667,17 +2667,17 @@ discard block |
||
2667 | 2667 | |
2668 | 2668 | case 1: |
2669 | 2669 | $l2 = $name; |
2670 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
2670 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
2671 | 2671 | break; |
2672 | 2672 | |
2673 | 2673 | case 2: |
2674 | 2674 | $l3 = $name; |
2675 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
2675 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
2676 | 2676 | break; |
2677 | 2677 | |
2678 | 2678 | case 3: |
2679 | 2679 | $l4 = $name; |
2680 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
2680 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
2681 | 2681 | } |
2682 | 2682 | |
2683 | 2683 | unset( $this_val, $n ); |
@@ -2696,8 +2696,8 @@ discard block |
||
2696 | 2696 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
2697 | 2697 | if ( $name == '' ) { |
2698 | 2698 | $vars[] = $val; |
2699 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
2700 | - $vars[ $l1 ] = $val; |
|
2699 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
2700 | + $vars[$l1] = $val; |
|
2701 | 2701 | } |
2702 | 2702 | } |
2703 | 2703 | |
@@ -2714,7 +2714,7 @@ discard block |
||
2714 | 2714 | 'new_tab' => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ), |
2715 | 2715 | ); |
2716 | 2716 | |
2717 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
2717 | + if ( ! isset( $tooltips[$name] ) ) { |
|
2718 | 2718 | return; |
2719 | 2719 | } |
2720 | 2720 | |
@@ -2724,7 +2724,7 @@ discard block |
||
2724 | 2724 | echo ' class="frm_help"'; |
2725 | 2725 | } |
2726 | 2726 | |
2727 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
2727 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
2728 | 2728 | |
2729 | 2729 | if ( 'open' != $class ) { |
2730 | 2730 | echo '"'; |
@@ -2783,13 +2783,13 @@ discard block |
||
2783 | 2783 | } |
2784 | 2784 | |
2785 | 2785 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
2786 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
2786 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
2787 | 2787 | return; |
2788 | 2788 | } |
2789 | 2789 | |
2790 | 2790 | if ( is_array( $val ) ) { |
2791 | 2791 | foreach ( $val as $k1 => $v1 ) { |
2792 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
2792 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
2793 | 2793 | unset( $k1, $v1 ); |
2794 | 2794 | } |
2795 | 2795 | } else { |
@@ -2797,7 +2797,7 @@ discard block |
||
2797 | 2797 | $val = stripslashes( $val ); |
2798 | 2798 | |
2799 | 2799 | // Add backslashes before double quotes and forward slashes only |
2800 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
2800 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
2801 | 2801 | } |
2802 | 2802 | } |
2803 | 2803 | |
@@ -2918,14 +2918,14 @@ discard block |
||
2918 | 2918 | continue; |
2919 | 2919 | } |
2920 | 2920 | $key = $input['name']; |
2921 | - if ( isset( $formatted[ $key ] ) ) { |
|
2922 | - if ( is_array( $formatted[ $key ] ) ) { |
|
2923 | - $formatted[ $key ][] = $input['value']; |
|
2921 | + if ( isset( $formatted[$key] ) ) { |
|
2922 | + if ( is_array( $formatted[$key] ) ) { |
|
2923 | + $formatted[$key][] = $input['value']; |
|
2924 | 2924 | } else { |
2925 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
2925 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
2926 | 2926 | } |
2927 | 2927 | } else { |
2928 | - $formatted[ $key ] = $input['value']; |
|
2928 | + $formatted[$key] = $input['value']; |
|
2929 | 2929 | } |
2930 | 2930 | } |
2931 | 2931 | |
@@ -3603,8 +3603,8 @@ discard block |
||
3603 | 3603 | } |
3604 | 3604 | |
3605 | 3605 | foreach ( $keys as $key ) { |
3606 | - if ( isset( $values[ $key ] ) ) { |
|
3607 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
3606 | + if ( isset( $values[$key] ) ) { |
|
3607 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
3608 | 3608 | } |
3609 | 3609 | } |
3610 | 3610 | |
@@ -3763,7 +3763,7 @@ discard block |
||
3763 | 3763 | return 0; |
3764 | 3764 | } |
3765 | 3765 | |
3766 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
3766 | + return strlen( $parts[count( $parts ) - 1] ); |
|
3767 | 3767 | } |
3768 | 3768 | |
3769 | 3769 | /** |
@@ -493,7 +493,8 @@ discard block |
||
493 | 493 | |
494 | 494 | if ( $src === 'get' ) { |
495 | 495 | $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
496 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
496 | + if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { |
|
497 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
497 | 498 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
498 | 499 | $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
499 | 500 | } |
@@ -581,7 +582,8 @@ discard block |
||
581 | 582 | $value = wp_unslash( $_GET[ $args['param'] ] ); |
582 | 583 | } |
583 | 584 | } elseif ( $args['type'] === 'post' ) { |
584 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
585 | + if ( isset( $_POST[ $args['param'] ] ) ) { |
|
586 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
585 | 587 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
586 | 588 | $value = wp_unslash( $_POST[ $args['param'] ] ); |
587 | 589 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
@@ -589,7 +591,8 @@ discard block |
||
589 | 591 | } |
590 | 592 | } |
591 | 593 | } else { |
592 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
594 | + if ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
595 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
593 | 596 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
594 | 597 | $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
595 | 598 | } |
@@ -16,10 +16,10 @@ |
||
16 | 16 | public static function get_currency( $currency ) { |
17 | 17 | $currency = strtoupper( $currency ); |
18 | 18 | $currencies = self::get_currencies(); |
19 | - if ( isset( $currencies[ $currency ] ) ) { |
|
20 | - $currency = $currencies[ $currency ]; |
|
21 | - } elseif ( isset( $currencies[ strtolower( $currency ) ] ) ) { |
|
22 | - $currency = $currencies[ strtolower( $currency ) ]; |
|
19 | + if ( isset( $currencies[$currency] ) ) { |
|
20 | + $currency = $currencies[$currency]; |
|
21 | + } elseif ( isset( $currencies[strtolower( $currency )] ) ) { |
|
22 | + $currency = $currencies[strtolower( $currency )]; |
|
23 | 23 | } else { |
24 | 24 | $currency = $currencies['usd']; |
25 | 25 | } |
@@ -464,8 +464,8 @@ |
||
464 | 464 | 'charge.refunded' => 'refunded', |
465 | 465 | ); |
466 | 466 | |
467 | - if ( isset( $events[ $this->event->type ] ) ) { |
|
468 | - $this->status = $events[ $this->event->type ]; |
|
467 | + if ( isset( $events[$this->event->type] ) ) { |
|
468 | + $this->status = $events[$this->event->type]; |
|
469 | 469 | $this->set_payment_status(); |
470 | 470 | } elseif ( $this->event->type === 'customer.deleted' ) { |
471 | 471 | $this->reset_customer(); |
@@ -100,7 +100,7 @@ |
||
100 | 100 | 'sort' => '', |
101 | 101 | 'sdir' => '', |
102 | 102 | ) as $var => $default ) { |
103 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default ); |
|
103 | + $values[$var] = FrmAppHelper::get_param( $var, $default ); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | return $values; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $gateway = $payment_action->post_content['gateway']; |
48 | 48 | $is_stripe = $gateway === 'stripe' || ( is_array( $gateway ) && in_array( 'stripe', $gateway, true ) ); |
49 | 49 | if ( ! $is_stripe || empty( $payment_action->post_content['amount'] ) ) { |
50 | - unset( $payment_actions[ $k ] ); |
|
50 | + unset( $payment_actions[$k] ); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | return $payment_actions; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 'run_triggers' => false, |
88 | 88 | 'show_errors' => true, |
89 | 89 | ); |
90 | - $atts = compact( 'action', 'entry', 'form' ); |
|
90 | + $atts = compact( 'action', 'entry', 'form' ); |
|
91 | 91 | |
92 | 92 | $amount = self::prepare_amount( $action->post_content['amount'], $atts ); |
93 | 93 | if ( empty( $amount ) || $amount == 000 ) { |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | $disallowed = array( ';', ':', '!important' ); |
509 | 509 | foreach ( $settings as $k => $s ) { |
510 | 510 | if ( is_string( $s ) ) { |
511 | - $settings[ $k ] = str_replace( $disallowed, '', $s ); |
|
511 | + $settings[$k] = str_replace( $disallowed, '', $s ); |
|
512 | 512 | } |
513 | 513 | } |
514 | 514 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | return $html; |
37 | 37 | } |
38 | 38 | |
39 | - $details = self::$details_by_form_id[ $form_id ]; |
|
39 | + $details = self::$details_by_form_id[$form_id]; |
|
40 | 40 | $atts = array( |
41 | 41 | 'fields' => FrmFieldsHelper::get_form_fields( $form_id ), |
42 | 42 | 'entry' => $details['entry'], |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | return false; |
144 | 144 | } |
145 | 145 | |
146 | - self::$details_by_form_id[ $form_id ] = array( |
|
146 | + self::$details_by_form_id[$form_id] = array( |
|
147 | 147 | 'entry' => $entry, |
148 | 148 | 'intent' => $intent, |
149 | 149 | 'payment' => $payment, |
150 | 150 | ); |
151 | 151 | |
152 | - return self::$details_by_form_id[ $form_id ]; |
|
152 | + return self::$details_by_form_id[$form_id]; |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $atts['form'] = FrmForm::getOne( $atts['entry']->form_id ); |
237 | 237 | $atts['entry_id'] = $atts['entry']->id; |
238 | 238 | $opt = 'success_action'; |
239 | - $atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
239 | + $atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
@@ -313,10 +313,10 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public static function get_payment_intents( $name ) { |
315 | 315 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
316 | - if ( ! isset( $_POST[ $name ] ) ) { |
|
316 | + if ( ! isset( $_POST[$name] ) ) { |
|
317 | 317 | return array(); |
318 | 318 | } |
319 | - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
319 | + $intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
320 | 320 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); |
321 | 321 | return $intents; |
322 | 322 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | self::format_form_data( $form ); |
344 | 344 | |
345 | 345 | $form_id = absint( $form['form_id'] ); |
346 | - $intents = isset( $form[ 'frmintent' . $form_id ] ) ? $form[ 'frmintent' . $form_id ] : array(); |
|
346 | + $intents = isset( $form['frmintent' . $form_id] ) ? $form['frmintent' . $form_id] : array(); |
|
347 | 347 | |
348 | 348 | if ( empty( $intents ) ) { |
349 | 349 | wp_die(); |
@@ -353,8 +353,8 @@ discard block |
||
353 | 353 | $intents = array( $intents ); |
354 | 354 | } else { |
355 | 355 | foreach ( $intents as $k => $intent ) { |
356 | - if ( is_array( $intent ) && isset( $intent[ $k ] ) ) { |
|
357 | - $intents[ $k ] = $intent[ $k ]; |
|
356 | + if ( is_array( $intent ) && isset( $intent[$k] ) ) { |
|
357 | + $intents[$k] = $intent[$k]; |
|
358 | 358 | } |
359 | 359 | } |
360 | 360 | } |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | if ( $saved->metadata->action != $action->ID ) { |
403 | 403 | continue; |
404 | 404 | } |
405 | - $intents[ $k ] = array( |
|
405 | + $intents[$k] = array( |
|
406 | 406 | 'id' => $intent, |
407 | 407 | 'action' => $action->ID, |
408 | 408 | ); |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | if ( $k === 'item_meta' ) { |
446 | 446 | foreach ( $v as $f => $value ) { |
447 | 447 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
448 | - $entry->metas[ absint( $f ) ] = $value; |
|
448 | + $entry->metas[absint( $f )] = $value; |
|
449 | 449 | } |
450 | 450 | } else { |
451 | 451 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -469,14 +469,14 @@ discard block |
||
469 | 469 | |
470 | 470 | foreach ( $form as $input ) { |
471 | 471 | $key = $input['name']; |
472 | - if ( isset( $formatted[ $key ] ) ) { |
|
473 | - if ( is_array( $formatted[ $key ] ) ) { |
|
474 | - $formatted[ $key ][] = $input['value']; |
|
472 | + if ( isset( $formatted[$key] ) ) { |
|
473 | + if ( is_array( $formatted[$key] ) ) { |
|
474 | + $formatted[$key][] = $input['value']; |
|
475 | 475 | } else { |
476 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
476 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
477 | 477 | } |
478 | 478 | } else { |
479 | - $formatted[ $key ] = $input['value']; |
|
479 | + $formatted[$key] = $input['value']; |
|
480 | 480 | } |
481 | 481 | } |
482 | 482 | |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | |
605 | 605 | foreach ( $actions as $k => $action ) { |
606 | 606 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
607 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
607 | + $actions[$k]->post_content['amount'] = $amount; |
|
608 | 608 | } |
609 | 609 | } |
610 | 610 |
@@ -84,8 +84,8 @@ |
||
84 | 84 | $settings = $this->default_options(); |
85 | 85 | |
86 | 86 | foreach ( $settings as $setting => $default ) { |
87 | - if ( isset( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ) { |
|
88 | - $this->settings->{$setting} = trim( sanitize_text_field( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ); |
|
87 | + if ( isset( $params['frm_' . $this->param() . '_' . $setting] ) ) { |
|
88 | + $this->settings->{$setting} = trim( sanitize_text_field( $params['frm_' . $this->param() . '_' . $setting] ) ); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 |
@@ -165,7 +165,7 @@ |
||
165 | 165 | $has_field = true; |
166 | 166 | $key_exists = array_key_exists( $field_atts['name'], $form_atts['form_action']->post_content ); |
167 | 167 | ?> |
168 | - <option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[ $field_atts['name'] ] : 0, $field->id ); ?>> |
|
168 | + <option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[$field_atts['name']] : 0, $field->id ); ?>> |
|
169 | 169 | <?php echo esc_attr( FrmAppHelper::truncate( $field->name, 50, 1 ) ); ?> |
170 | 170 | </option> |
171 | 171 | <?php |