@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | foreach ( $errors as $field => $error ) { |
89 | 89 | $field_id = str_replace( 'field', '', $field ); |
90 | 90 | $error = self::maybe_modify_ajax_error( $error, $field_id, $form, $errors ); |
91 | - $obj[ $field_id ] = $error; |
|
91 | + $obj[$field_id] = $error; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | $response['errors'] = $obj; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | private static function fix_woocommerce_conflict() { |
120 | 120 | add_action( |
121 | 121 | 'wp_print_footer_scripts', |
122 | - function () { |
|
122 | + function() { |
|
123 | 123 | if ( ! function_exists( 'get_current_screen' ) ) { |
124 | 124 | require_once ABSPATH . 'wp-admin/includes/screen.php'; |
125 | 125 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | if ( is_admin() ) { |
19 | 19 | add_action( |
20 | 20 | 'elementor/editor/after_enqueue_styles', |
21 | - function () { |
|
21 | + function() { |
|
22 | 22 | wp_enqueue_style( 'font_icons', FrmAppHelper::plugin_url() . '/css/font_icons.css', array(), FrmAppHelper::plugin_version() ); |
23 | 23 | } |
24 | 24 | ); |
@@ -154,7 +154,7 @@ |
||
154 | 154 | private static function sort_templates( $applications ) { |
155 | 155 | usort( |
156 | 156 | $applications, |
157 | - function ( $a, $b ) { |
|
157 | + function( $a, $b ) { |
|
158 | 158 | return strcmp( $a['name'], $b['name'] ); |
159 | 159 | } |
160 | 160 | ); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | * @param string $row_view_file_path |
35 | 35 | * @return void |
36 | 36 | */ |
37 | - function ( $form ) use ( $styles, $default_style, $row_view_file_path ) { |
|
37 | + function( $form ) use ( $styles, $default_style, $row_view_file_path ) { |
|
38 | 38 | $active_style_id = isset( $form->options['custom_style'] ) ? (int) $form->options['custom_style'] : 1; |
39 | 39 | if ( 1 === $active_style_id ) { |
40 | 40 | // use the default style |
@@ -19,7 +19,7 @@ |
||
19 | 19 | $show_messages = apply_filters( 'frm_message_list', $show_messages ); |
20 | 20 | if ( is_array( $show_messages ) && count( $show_messages ) > 0 ) { |
21 | 21 | // Define a callback function to add 'data-action' attribute to allowed HTML tags |
22 | - $add_data_action_callback = function ( $allowed_html ) { |
|
22 | + $add_data_action_callback = function( $allowed_html ) { |
|
23 | 23 | $allowed_html['span']['data-action'] = true; |
24 | 24 | return $allowed_html; |
25 | 25 | }; |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | |
19 | 19 | foreach ( $type as $tb_type ) { |
20 | 20 | |
21 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
21 | + if ( ! isset( $tables[$tb_type] ) ) { |
|
22 | 22 | do_action( 'frm_xml_import_' . $tb_type, $args ); |
23 | 23 | continue; |
24 | 24 | } |
25 | 25 | |
26 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
26 | + if ( ! isset( $records[$tb_type] ) ) { |
|
27 | 27 | // No records. |
28 | 28 | continue; |
29 | 29 | } |
30 | 30 | |
31 | - $item_ids = $records[ $tb_type ]; |
|
31 | + $item_ids = $records[$tb_type]; |
|
32 | 32 | |
33 | 33 | if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) { |
34 | 34 | include __DIR__ . '/posts_xml.php'; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | include FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php'; |
39 | 39 | } |
40 | 40 | |
41 | - unset( $item_ids, $records[ $tb_type ], $tb_type ); |
|
41 | + unset( $item_ids, $records[$tb_type], $tb_type ); |
|
42 | 42 | }//end foreach |
43 | 43 | |
44 | 44 | /** |
@@ -28,7 +28,7 @@ |
||
28 | 28 | wp_enqueue_script( 'formidable_settings' ); |
29 | 29 | return FrmAppHelper::clip( |
30 | 30 | // @phpstan-ignore-next-line |
31 | - function () use ( $id, $name, $args ) { |
|
31 | + function() use ( $id, $name, $args ) { |
|
32 | 32 | require FrmAppHelper::plugin_path() . '/classes/views/shared/toggle.php'; |
33 | 33 | }, |
34 | 34 | isset( $args['echo'] ) ? $args['echo'] : false |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | public function __construct( $data ) { |
90 | 90 | $sections = array( 'counters', 'license', 'payments', 'entries', 'inbox', 'video', 'payments' ); |
91 | 91 | foreach ( $sections as $section ) { |
92 | - if ( isset( $data[ $section ] ) ) { |
|
93 | - $this->view[ $section ] = $data[ $section ]; |
|
92 | + if ( isset( $data[$section] ) ) { |
|
93 | + $this->view[$section] = $data[$section]; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | private static function load_entries_list_template( $template ) { |
338 | 338 | add_filter( |
339 | 339 | 'formidable_page_formidable_entries_per_page', |
340 | - function () { |
|
340 | + function() { |
|
341 | 341 | return 7; |
342 | 342 | } |
343 | 343 | ); |
@@ -524,7 +524,8 @@ discard block |
||
524 | 524 | |
525 | 525 | if ( $src === 'get' ) { |
526 | 526 | $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 |
527 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
527 | + if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { |
|
528 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
528 | 529 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
529 | 530 | $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
530 | 531 | } |
@@ -612,7 +613,8 @@ discard block |
||
612 | 613 | $value = wp_unslash( $_GET[ $args['param'] ] ); |
613 | 614 | } |
614 | 615 | } elseif ( $args['type'] === 'post' ) { |
615 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
616 | + if ( isset( $_POST[ $args['param'] ] ) ) { |
|
617 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
616 | 618 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
617 | 619 | $value = wp_unslash( $_POST[ $args['param'] ] ); |
618 | 620 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | 'fill' => '#4d4d4d', |
225 | 225 | 'orange' => '#f05a24', |
226 | 226 | ); |
227 | - $atts = array_merge( $defaults, $atts ); |
|
227 | + $atts = array_merge( $defaults, $atts ); |
|
228 | 228 | |
229 | 229 | 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'] ) . '"> |
230 | 230 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | * @return string |
469 | 469 | */ |
470 | 470 | public static function get_server_value( $value ) { |
471 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
471 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
472 | 472 | } |
473 | 473 | |
474 | 474 | /** |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | $ip = ''; |
503 | 503 | |
504 | 504 | foreach ( $ip_options as $key ) { |
505 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
505 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
506 | 506 | continue; |
507 | 507 | } |
508 | 508 | |
@@ -571,10 +571,10 @@ discard block |
||
571 | 571 | } |
572 | 572 | |
573 | 573 | if ( $src === 'get' ) { |
574 | - $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 |
|
575 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
574 | + $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 |
|
575 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
576 | 576 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
577 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
577 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
578 | 578 | } |
579 | 579 | self::sanitize_value( $sanitize, $value ); |
580 | 580 | } else { |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | } |
596 | 596 | |
597 | 597 | $p = trim( $p, ']' ); |
598 | - $value = isset( $value[ $p ] ) ? $value[ $p ] : $default; |
|
598 | + $value = isset( $value[$p] ) ? $value[$p] : $default; |
|
599 | 599 | } |
600 | 600 | } |
601 | 601 | |
@@ -660,26 +660,26 @@ discard block |
||
660 | 660 | 'sanitize' => 'sanitize_text_field', |
661 | 661 | 'serialized' => false, |
662 | 662 | ); |
663 | - $args = wp_parse_args( $args, $defaults ); |
|
663 | + $args = wp_parse_args( $args, $defaults ); |
|
664 | 664 | |
665 | 665 | $value = $args['default']; |
666 | 666 | if ( $args['type'] === 'get' ) { |
667 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
667 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
668 | 668 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
669 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
669 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
670 | 670 | } |
671 | 671 | } elseif ( $args['type'] === 'post' ) { |
672 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
672 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
673 | 673 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
674 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
674 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
675 | 675 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
676 | 676 | self::unserialize_or_decode( $value ); |
677 | 677 | } |
678 | 678 | } |
679 | - } elseif ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
679 | + } elseif ( isset( $_REQUEST[$args['param']] ) ) { |
|
680 | 680 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
681 | 681 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
682 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
682 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
683 | 683 | } |
684 | 684 | |
685 | 685 | self::sanitize_value( $args['sanitize'], $value ); |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | if ( is_array( $value ) ) { |
727 | 727 | $temp_values = $value; |
728 | 728 | foreach ( $temp_values as $k => $v ) { |
729 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
729 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
730 | 730 | } |
731 | 731 | return; |
732 | 732 | } |
@@ -737,8 +737,8 @@ discard block |
||
737 | 737 | public static function sanitize_request( $sanitize_method, &$values ) { |
738 | 738 | $temp_values = $values; |
739 | 739 | foreach ( $temp_values as $k => $val ) { |
740 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
741 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
740 | + if ( isset( $sanitize_method[$k] ) ) { |
|
741 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
742 | 742 | } |
743 | 743 | } |
744 | 744 | } |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | if ( is_array( $value ) ) { |
799 | 799 | $temp_values = $value; |
800 | 800 | foreach ( $temp_values as $k => $v ) { |
801 | - self::decode_specialchars( $value[ $k ] ); |
|
801 | + self::decode_specialchars( $value[$k] ); |
|
802 | 802 | } |
803 | 803 | } else { |
804 | 804 | self::decode_amp( $value ); |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | * @return array |
921 | 921 | */ |
922 | 922 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
923 | - $allowed_html['input'] = array( |
|
923 | + $allowed_html['input'] = array( |
|
924 | 924 | 'type' => true, |
925 | 925 | 'value' => true, |
926 | 926 | 'formnovalidate' => true, |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | $allowed_html = $html; |
944 | 944 | } elseif ( ! empty( $allowed ) ) { |
945 | 945 | foreach ( (array) $allowed as $a ) { |
946 | - $allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array(); |
|
946 | + $allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array(); |
|
947 | 947 | } |
948 | 948 | } |
949 | 949 | |
@@ -1122,8 +1122,8 @@ discard block |
||
1122 | 1122 | } |
1123 | 1123 | |
1124 | 1124 | global $wp_query; |
1125 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
1126 | - $value = $wp_query->query_vars[ $param ]; |
|
1125 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
1126 | + $value = $wp_query->query_vars[$param]; |
|
1127 | 1127 | } |
1128 | 1128 | |
1129 | 1129 | return $value; |
@@ -1154,9 +1154,9 @@ discard block |
||
1154 | 1154 | 'frm_keyalt_icon' => 'frm_key_icon', |
1155 | 1155 | 'frm_keyalt_solid_icon' => 'frm_key_solid_icon', |
1156 | 1156 | ); |
1157 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
1158 | - $icon = $deprecated[ $icon ]; |
|
1159 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
1157 | + if ( isset( $deprecated[$icon] ) ) { |
|
1158 | + $icon = $deprecated[$icon]; |
|
1159 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
1160 | 1160 | } |
1161 | 1161 | |
1162 | 1162 | if ( $icon === $class ) { |
@@ -1278,7 +1278,7 @@ discard block |
||
1278 | 1278 | * @return string|void |
1279 | 1279 | */ |
1280 | 1280 | public static function array_to_html_params( $atts, $echo = false ) { |
1281 | - $callback = function () use ( $atts ) { |
|
1281 | + $callback = function() use ( $atts ) { |
|
1282 | 1282 | if ( $atts ) { |
1283 | 1283 | foreach ( $atts as $key => $value ) { |
1284 | 1284 | echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
@@ -1429,7 +1429,7 @@ discard block |
||
1429 | 1429 | 'input_id' => '', |
1430 | 1430 | 'value' => false, |
1431 | 1431 | ); |
1432 | - $atts = array_merge( $defaults, $atts ); |
|
1432 | + $atts = array_merge( $defaults, $atts ); |
|
1433 | 1433 | |
1434 | 1434 | if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) { |
1435 | 1435 | $atts['tosearch'] = 'frm-card'; |
@@ -1505,7 +1505,7 @@ discard block |
||
1505 | 1505 | 'new_file_path' => self::plugin_path() . '/js', |
1506 | 1506 | ) |
1507 | 1507 | ); |
1508 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1508 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1509 | 1509 | |
1510 | 1510 | $files = array( |
1511 | 1511 | self::plugin_path() . '/js/formidable.min.js', |
@@ -2018,8 +2018,8 @@ discard block |
||
2018 | 2018 | return $error; |
2019 | 2019 | } |
2020 | 2020 | |
2021 | - $nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
2022 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
2021 | + $nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
2022 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
2023 | 2023 | $frm_settings = self::get_settings(); |
2024 | 2024 | $error = $frm_settings->admin_permission; |
2025 | 2025 | } |
@@ -2055,7 +2055,7 @@ discard block |
||
2055 | 2055 | } else { |
2056 | 2056 | foreach ( $value as $k => $v ) { |
2057 | 2057 | if ( ! is_array( $v ) ) { |
2058 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
2058 | + $value[$k] = call_user_func( $original_function, $v ); |
|
2059 | 2059 | } |
2060 | 2060 | } |
2061 | 2061 | } |
@@ -2096,7 +2096,7 @@ discard block |
||
2096 | 2096 | if ( is_array( $value ) ) { |
2097 | 2097 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
2098 | 2098 | } elseif ( $keys === 'keep' ) { |
2099 | - $return[ $key ] = $value; |
|
2099 | + $return[$key] = $value; |
|
2100 | 2100 | } else { |
2101 | 2101 | $return[] = $value; |
2102 | 2102 | } |
@@ -2157,11 +2157,11 @@ discard block |
||
2157 | 2157 | } |
2158 | 2158 | |
2159 | 2159 | $ver = $default; |
2160 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
2160 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
2161 | 2161 | return $ver; |
2162 | 2162 | } |
2163 | 2163 | |
2164 | - $query = $wp_scripts->registered[ $handle ]; |
|
2164 | + $query = $wp_scripts->registered[$handle]; |
|
2165 | 2165 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
2166 | 2166 | $ver = $query->ver; |
2167 | 2167 | } |
@@ -2177,7 +2177,7 @@ discard block |
||
2177 | 2177 | * @return string|null |
2178 | 2178 | */ |
2179 | 2179 | public static function js_redirect( $url, $echo = false ) { |
2180 | - $callback = function () use ( $url ) { |
|
2180 | + $callback = function() use ( $url ) { |
|
2181 | 2181 | echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>'; |
2182 | 2182 | }; |
2183 | 2183 | return self::clip( $callback, $echo ); |
@@ -2272,7 +2272,7 @@ discard block |
||
2272 | 2272 | $suffix = 2; |
2273 | 2273 | do { |
2274 | 2274 | $key_check = $key . $separator . $suffix; |
2275 | - ++$suffix; |
|
2275 | + ++ $suffix; |
|
2276 | 2276 | } while ( in_array( $key_check, $similar_keys, true ) ); |
2277 | 2277 | |
2278 | 2278 | $key = $key_check; |
@@ -2380,7 +2380,7 @@ discard block |
||
2380 | 2380 | |
2381 | 2381 | foreach ( array( 'name', 'description' ) as $var ) { |
2382 | 2382 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
2383 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2383 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2384 | 2384 | unset( $var, $default_val ); |
2385 | 2385 | } |
2386 | 2386 | |
@@ -2436,9 +2436,9 @@ discard block |
||
2436 | 2436 | $meta_value = FrmEntryMeta::get_meta_value( $record, $field->id ); |
2437 | 2437 | }//end if |
2438 | 2438 | |
2439 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
2440 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
2441 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
2439 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
2440 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
2441 | + $new_value = $post_values['item_meta'][$field->id]; |
|
2442 | 2442 | self::unserialize_or_decode( $new_value ); |
2443 | 2443 | } else { |
2444 | 2444 | $new_value = $meta_value; |
@@ -2459,7 +2459,7 @@ discard block |
||
2459 | 2459 | |
2460 | 2460 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
2461 | 2461 | |
2462 | - $values['fields'][ $field->id ] = $field_array; |
|
2462 | + $values['fields'][$field->id] = $field_array; |
|
2463 | 2463 | } |
2464 | 2464 | |
2465 | 2465 | /** |
@@ -2509,11 +2509,11 @@ discard block |
||
2509 | 2509 | } |
2510 | 2510 | |
2511 | 2511 | foreach ( $form->options as $opt => $value ) { |
2512 | - if ( isset( $post_values[ $opt ] ) ) { |
|
2513 | - $values[ $opt ] = $post_values[ $opt ]; |
|
2514 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
2512 | + if ( isset( $post_values[$opt] ) ) { |
|
2513 | + $values[$opt] = $post_values[$opt]; |
|
2514 | + self::unserialize_or_decode( $values[$opt] ); |
|
2515 | 2515 | } else { |
2516 | - $values[ $opt ] = $value; |
|
2516 | + $values[$opt] = $value; |
|
2517 | 2517 | } |
2518 | 2518 | } |
2519 | 2519 | |
@@ -2527,8 +2527,8 @@ discard block |
||
2527 | 2527 | $form_defaults = FrmFormsHelper::get_default_opts(); |
2528 | 2528 | |
2529 | 2529 | foreach ( $form_defaults as $opt => $default ) { |
2530 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
2531 | - $values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default; |
|
2530 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
2531 | + $values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default; |
|
2532 | 2532 | } |
2533 | 2533 | |
2534 | 2534 | unset( $opt, $default ); |
@@ -2539,8 +2539,8 @@ discard block |
||
2539 | 2539 | } |
2540 | 2540 | |
2541 | 2541 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
2542 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
2543 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
2542 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
2543 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
2544 | 2544 | } |
2545 | 2545 | unset( $h ); |
2546 | 2546 | } |
@@ -2730,25 +2730,25 @@ discard block |
||
2730 | 2730 | if ( ! is_numeric( $levels ) ) { |
2731 | 2731 | // Show time in specified unit. |
2732 | 2732 | $levels = self::get_unit( $levels ); |
2733 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
2733 | + if ( isset( $time_strings[$levels] ) ) { |
|
2734 | 2734 | $diff = array( |
2735 | 2735 | $levels => self::time_format( $levels, $diff ), |
2736 | 2736 | ); |
2737 | 2737 | $time_strings = array( |
2738 | - $levels => $time_strings[ $levels ], |
|
2738 | + $levels => $time_strings[$levels], |
|
2739 | 2739 | ); |
2740 | 2740 | } |
2741 | 2741 | $levels = 1; |
2742 | 2742 | } |
2743 | 2743 | |
2744 | 2744 | foreach ( $time_strings as $k => $v ) { |
2745 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
2746 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
2747 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
2745 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
2746 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
2747 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
2748 | 2748 | // Account for 0. |
2749 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
2749 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
2750 | 2750 | } else { |
2751 | - unset( $time_strings[ $k ] ); |
|
2751 | + unset( $time_strings[$k] ); |
|
2752 | 2752 | } |
2753 | 2753 | } |
2754 | 2754 | |
@@ -2767,8 +2767,8 @@ discard block |
||
2767 | 2767 | 'y' => 'y', |
2768 | 2768 | 'd' => 'days', |
2769 | 2769 | ); |
2770 | - if ( isset( $return[ $unit ] ) ) { |
|
2771 | - return $diff[ $return[ $unit ] ]; |
|
2770 | + if ( isset( $return[$unit] ) ) { |
|
2771 | + return $diff[$return[$unit]]; |
|
2772 | 2772 | } |
2773 | 2773 | |
2774 | 2774 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -2776,11 +2776,11 @@ discard block |
||
2776 | 2776 | $times = array( 'h', 'i', 's' ); |
2777 | 2777 | |
2778 | 2778 | foreach ( $times as $time ) { |
2779 | - if ( ! isset( $diff[ $time ] ) ) { |
|
2779 | + if ( ! isset( $diff[$time] ) ) { |
|
2780 | 2780 | continue; |
2781 | 2781 | } |
2782 | 2782 | |
2783 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
2783 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
2784 | 2784 | } |
2785 | 2785 | |
2786 | 2786 | return floor( $total ); |
@@ -2800,7 +2800,7 @@ discard block |
||
2800 | 2800 | 'y' => DAY_IN_SECONDS * 365.25, |
2801 | 2801 | ); |
2802 | 2802 | |
2803 | - return $convert[ $from ] / $convert[ $to ]; |
|
2803 | + return $convert[$from] / $convert[$to]; |
|
2804 | 2804 | } |
2805 | 2805 | |
2806 | 2806 | /** |
@@ -2808,7 +2808,7 @@ discard block |
||
2808 | 2808 | */ |
2809 | 2809 | private static function get_unit( $unit ) { |
2810 | 2810 | $units = self::get_time_strings(); |
2811 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
2811 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
2812 | 2812 | return $unit; |
2813 | 2813 | } |
2814 | 2814 | |
@@ -2924,17 +2924,17 @@ discard block |
||
2924 | 2924 | |
2925 | 2925 | case 1: |
2926 | 2926 | $l2 = $name; |
2927 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
2927 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
2928 | 2928 | break; |
2929 | 2929 | |
2930 | 2930 | case 2: |
2931 | 2931 | $l3 = $name; |
2932 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
2932 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
2933 | 2933 | break; |
2934 | 2934 | |
2935 | 2935 | case 3: |
2936 | 2936 | $l4 = $name; |
2937 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
2937 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
2938 | 2938 | } |
2939 | 2939 | |
2940 | 2940 | unset( $this_val, $n ); |
@@ -2953,8 +2953,8 @@ discard block |
||
2953 | 2953 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
2954 | 2954 | if ( $name == '' ) { |
2955 | 2955 | $vars[] = $val; |
2956 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
2957 | - $vars[ $l1 ] = $val; |
|
2956 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
2957 | + $vars[$l1] = $val; |
|
2958 | 2958 | } |
2959 | 2959 | } |
2960 | 2960 | |
@@ -2971,7 +2971,7 @@ discard block |
||
2971 | 2971 | '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' ), |
2972 | 2972 | ); |
2973 | 2973 | |
2974 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
2974 | + if ( ! isset( $tooltips[$name] ) ) { |
|
2975 | 2975 | return; |
2976 | 2976 | } |
2977 | 2977 | |
@@ -2981,7 +2981,7 @@ discard block |
||
2981 | 2981 | echo ' class="frm_help"'; |
2982 | 2982 | } |
2983 | 2983 | |
2984 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
2984 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
2985 | 2985 | |
2986 | 2986 | if ( 'open' != $class ) { |
2987 | 2987 | echo '"'; |
@@ -3040,13 +3040,13 @@ discard block |
||
3040 | 3040 | } |
3041 | 3041 | |
3042 | 3042 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
3043 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
3043 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
3044 | 3044 | return; |
3045 | 3045 | } |
3046 | 3046 | |
3047 | 3047 | if ( is_array( $val ) ) { |
3048 | 3048 | foreach ( $val as $k1 => $v1 ) { |
3049 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
3049 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
3050 | 3050 | unset( $k1, $v1 ); |
3051 | 3051 | } |
3052 | 3052 | } else { |
@@ -3054,7 +3054,7 @@ discard block |
||
3054 | 3054 | $val = stripslashes( $val ); |
3055 | 3055 | |
3056 | 3056 | // Add backslashes before double quotes and forward slashes only |
3057 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
3057 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
3058 | 3058 | } |
3059 | 3059 | } |
3060 | 3060 | |
@@ -3175,14 +3175,14 @@ discard block |
||
3175 | 3175 | continue; |
3176 | 3176 | } |
3177 | 3177 | $key = $input['name']; |
3178 | - if ( isset( $formatted[ $key ] ) ) { |
|
3179 | - if ( is_array( $formatted[ $key ] ) ) { |
|
3180 | - $formatted[ $key ][] = $input['value']; |
|
3178 | + if ( isset( $formatted[$key] ) ) { |
|
3179 | + if ( is_array( $formatted[$key] ) ) { |
|
3180 | + $formatted[$key][] = $input['value']; |
|
3181 | 3181 | } else { |
3182 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
3182 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
3183 | 3183 | } |
3184 | 3184 | } else { |
3185 | - $formatted[ $key ] = $input['value']; |
|
3185 | + $formatted[$key] = $input['value']; |
|
3186 | 3186 | } |
3187 | 3187 | } |
3188 | 3188 | |
@@ -3908,8 +3908,8 @@ discard block |
||
3908 | 3908 | } |
3909 | 3909 | |
3910 | 3910 | foreach ( $keys as $key ) { |
3911 | - if ( isset( $values[ $key ] ) ) { |
|
3912 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
3911 | + if ( isset( $values[$key] ) ) { |
|
3912 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
3913 | 3913 | } |
3914 | 3914 | } |
3915 | 3915 | |
@@ -3974,7 +3974,7 @@ discard block |
||
3974 | 3974 | 'role', |
3975 | 3975 | 'style', |
3976 | 3976 | ); |
3977 | - $safe = in_array( $key, $safe_keys, true ); |
|
3977 | + $safe = in_array( $key, $safe_keys, true ); |
|
3978 | 3978 | }//end if |
3979 | 3979 | |
3980 | 3980 | /** |
@@ -4113,7 +4113,7 @@ discard block |
||
4113 | 4113 | return 0; |
4114 | 4114 | } |
4115 | 4115 | |
4116 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
4116 | + return strlen( $parts[count( $parts ) - 1] ); |
|
4117 | 4117 | } |
4118 | 4118 | |
4119 | 4119 | /** |
@@ -4133,7 +4133,7 @@ discard block |
||
4133 | 4133 | |
4134 | 4134 | add_filter( |
4135 | 4135 | 'option_gmt_offset', |
4136 | - function ( $offset ) { |
|
4136 | + function( $offset ) { |
|
4137 | 4137 | if ( ! is_string( $offset ) || is_numeric( $offset ) ) { |
4138 | 4138 | // Leave a valid value alone. |
4139 | 4139 | return $offset; |
@@ -4230,7 +4230,7 @@ discard block |
||
4230 | 4230 | return; |
4231 | 4231 | } |
4232 | 4232 | |
4233 | - $ajax_callback = function () use ( $option ) { |
|
4233 | + $ajax_callback = function() use ( $option ) { |
|
4234 | 4234 | self::dismiss_warning_message( $option ); |
4235 | 4235 | }; |
4236 | 4236 | |
@@ -4240,7 +4240,7 @@ discard block |
||
4240 | 4240 | |
4241 | 4241 | add_filter( |
4242 | 4242 | 'frm_message_list', |
4243 | - function ( $show_messages ) use ( $message, $option ) { |
|
4243 | + function( $show_messages ) use ( $message, $option ) { |
|
4244 | 4244 | if ( get_option( $option, false ) ) { |
4245 | 4245 | return $show_messages; |
4246 | 4246 | } |