@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | 'fill' => '#4d4d4d', |
| 339 | 339 | 'orange' => '#f05a24', |
| 340 | 340 | ); |
| 341 | - $atts = array_merge( $defaults, $atts ); |
|
| 341 | + $atts = array_merge( $defaults, $atts ); |
|
| 342 | 342 | |
| 343 | 343 | 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'] ) . '"> |
| 344 | 344 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | * @return string |
| 638 | 638 | */ |
| 639 | 639 | public static function get_server_value( $value ) { |
| 640 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
| 640 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | /** |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | $ip = ''; |
| 672 | 672 | |
| 673 | 673 | foreach ( $ip_options as $key ) { |
| 674 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
| 674 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
| 675 | 675 | continue; |
| 676 | 676 | } |
| 677 | 677 | |
@@ -749,11 +749,11 @@ discard block |
||
| 749 | 749 | } |
| 750 | 750 | |
| 751 | 751 | if ( $src === 'get' ) { |
| 752 | - $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 |
|
| 752 | + $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 |
|
| 753 | 753 | |
| 754 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 754 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 755 | 755 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 756 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
| 756 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
| 757 | 757 | } |
| 758 | 758 | self::sanitize_value( $sanitize, $value ); |
| 759 | 759 | } else { |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | $p = trim( $p, ']' ); |
| 777 | - $value = $value[ $p ] ?? $default; |
|
| 777 | + $value = $value[$p] ?? $default; |
|
| 778 | 778 | } |
| 779 | 779 | } |
| 780 | 780 | |
@@ -840,28 +840,28 @@ discard block |
||
| 840 | 840 | 'sanitize' => 'sanitize_text_field', |
| 841 | 841 | 'serialized' => false, |
| 842 | 842 | ); |
| 843 | - $args = wp_parse_args( $args, $defaults ); |
|
| 843 | + $args = wp_parse_args( $args, $defaults ); |
|
| 844 | 844 | |
| 845 | 845 | $value = $args['default']; |
| 846 | 846 | |
| 847 | 847 | if ( $args['type'] === 'get' ) { |
| 848 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
| 848 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
| 849 | 849 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 850 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
| 850 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
| 851 | 851 | } |
| 852 | 852 | } elseif ( $args['type'] === 'post' ) { |
| 853 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 853 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 854 | 854 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 855 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
| 855 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
| 856 | 856 | |
| 857 | 857 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
| 858 | 858 | self::unserialize_or_decode( $value ); |
| 859 | 859 | } |
| 860 | 860 | } |
| 861 | - } elseif ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
| 861 | + } elseif ( isset( $_REQUEST[$args['param']] ) ) { |
|
| 862 | 862 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 863 | 863 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 864 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
| 864 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
| 865 | 865 | } |
| 866 | 866 | |
| 867 | 867 | self::sanitize_value( $args['sanitize'], $value ); |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | $temp_values = $value; |
| 911 | 911 | |
| 912 | 912 | foreach ( $temp_values as $k => $v ) { |
| 913 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
| 913 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
| 914 | 914 | } |
| 915 | 915 | return; |
| 916 | 916 | } |
@@ -928,8 +928,8 @@ discard block |
||
| 928 | 928 | $temp_values = $values; |
| 929 | 929 | |
| 930 | 930 | foreach ( $temp_values as $k => $val ) { |
| 931 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
| 932 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
| 931 | + if ( isset( $sanitize_method[$k] ) ) { |
|
| 932 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
| 933 | 933 | } |
| 934 | 934 | } |
| 935 | 935 | } |
@@ -993,7 +993,7 @@ discard block |
||
| 993 | 993 | $temp_values = $value; |
| 994 | 994 | |
| 995 | 995 | foreach ( $temp_values as $k => $v ) { |
| 996 | - self::decode_specialchars( $value[ $k ] ); |
|
| 996 | + self::decode_specialchars( $value[$k] ); |
|
| 997 | 997 | } |
| 998 | 998 | } else { |
| 999 | 999 | self::decode_amp( $value ); |
@@ -1135,7 +1135,7 @@ discard block |
||
| 1135 | 1135 | * @return array |
| 1136 | 1136 | */ |
| 1137 | 1137 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
| 1138 | - $allowed_html['input'] = array( |
|
| 1138 | + $allowed_html['input'] = array( |
|
| 1139 | 1139 | 'type' => true, |
| 1140 | 1140 | 'value' => true, |
| 1141 | 1141 | 'formnovalidate' => true, |
@@ -1163,7 +1163,7 @@ discard block |
||
| 1163 | 1163 | $allowed_html = $html; |
| 1164 | 1164 | } elseif ( ! empty( $allowed ) ) { |
| 1165 | 1165 | foreach ( (array) $allowed as $a ) { |
| 1166 | - $allowed_html[ $a ] = $html[ $a ] ?? array(); |
|
| 1166 | + $allowed_html[$a] = $html[$a] ?? array(); |
|
| 1167 | 1167 | } |
| 1168 | 1168 | } |
| 1169 | 1169 | |
@@ -1354,8 +1354,8 @@ discard block |
||
| 1354 | 1354 | |
| 1355 | 1355 | global $wp_query; |
| 1356 | 1356 | |
| 1357 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
| 1358 | - $value = $wp_query->query_vars[ $param ]; |
|
| 1357 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
| 1358 | + $value = $wp_query->query_vars[$param]; |
|
| 1359 | 1359 | } |
| 1360 | 1360 | |
| 1361 | 1361 | return $value; |
@@ -1389,9 +1389,9 @@ discard block |
||
| 1389 | 1389 | 'frm_keyalt_solid_icon' => 'frm_key_solid_icon', |
| 1390 | 1390 | ); |
| 1391 | 1391 | |
| 1392 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
| 1393 | - $icon = $deprecated[ $icon ]; |
|
| 1394 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
| 1392 | + if ( isset( $deprecated[$icon] ) ) { |
|
| 1393 | + $icon = $deprecated[$icon]; |
|
| 1394 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
| 1395 | 1395 | } |
| 1396 | 1396 | |
| 1397 | 1397 | if ( $icon === $class ) { |
@@ -1523,7 +1523,7 @@ discard block |
||
| 1523 | 1523 | * @return string|void |
| 1524 | 1524 | */ |
| 1525 | 1525 | public static function array_to_html_params( $atts, $echo = false ) { |
| 1526 | - $callback = function () use ( $atts ) { |
|
| 1526 | + $callback = function() use ( $atts ) { |
|
| 1527 | 1527 | if ( $atts ) { |
| 1528 | 1528 | foreach ( $atts as $key => $value ) { |
| 1529 | 1529 | echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
@@ -1714,7 +1714,7 @@ discard block |
||
| 1714 | 1714 | 'value' => false, |
| 1715 | 1715 | 'class' => '', |
| 1716 | 1716 | ); |
| 1717 | - $atts = array_merge( $defaults, $atts ); |
|
| 1717 | + $atts = array_merge( $defaults, $atts ); |
|
| 1718 | 1718 | |
| 1719 | 1719 | if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) { |
| 1720 | 1720 | $atts['tosearch'] = 'frm-card'; |
@@ -1794,7 +1794,7 @@ discard block |
||
| 1794 | 1794 | 'new_file_path' => self::plugin_path() . '/js', |
| 1795 | 1795 | ) |
| 1796 | 1796 | ); |
| 1797 | - $new_file = new FrmCreateFile( $file_atts ); |
|
| 1797 | + $new_file = new FrmCreateFile( $file_atts ); |
|
| 1798 | 1798 | |
| 1799 | 1799 | $files = array( |
| 1800 | 1800 | self::plugin_path() . '/js/formidable.min.js', |
@@ -2014,8 +2014,8 @@ discard block |
||
| 2014 | 2014 | */ |
| 2015 | 2015 | private static function get_dropdown_value_and_label_from_option( $option, $key, $args ) { |
| 2016 | 2016 | if ( is_array( $option ) ) { |
| 2017 | - $value = $option[ $args['value_key'] ] ?? ''; |
|
| 2018 | - $label = $option[ $args['label_key'] ] ?? ''; |
|
| 2017 | + $value = $option[$args['value_key']] ?? ''; |
|
| 2018 | + $label = $option[$args['label_key']] ?? ''; |
|
| 2019 | 2019 | } else { |
| 2020 | 2020 | $value = $key; |
| 2021 | 2021 | $label = $option; |
@@ -2423,9 +2423,9 @@ discard block |
||
| 2423 | 2423 | return $error; |
| 2424 | 2424 | } |
| 2425 | 2425 | |
| 2426 | - $nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
| 2426 | + $nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
| 2427 | 2427 | |
| 2428 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
| 2428 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
| 2429 | 2429 | $frm_settings = self::get_settings(); |
| 2430 | 2430 | $error = $frm_settings->admin_permission; |
| 2431 | 2431 | } |
@@ -2481,7 +2481,7 @@ discard block |
||
| 2481 | 2481 | } else { |
| 2482 | 2482 | foreach ( $value as $k => $v ) { |
| 2483 | 2483 | if ( ! is_array( $v ) ) { |
| 2484 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
| 2484 | + $value[$k] = call_user_func( $original_function, $v ); |
|
| 2485 | 2485 | } |
| 2486 | 2486 | } |
| 2487 | 2487 | } |
@@ -2535,7 +2535,7 @@ discard block |
||
| 2535 | 2535 | if ( is_array( $value ) ) { |
| 2536 | 2536 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
| 2537 | 2537 | } elseif ( $keys === 'keep' ) { |
| 2538 | - $return[ $key ] = $value; |
|
| 2538 | + $return[$key] = $value; |
|
| 2539 | 2539 | } else { |
| 2540 | 2540 | $return[] = $value; |
| 2541 | 2541 | } |
@@ -2630,11 +2630,11 @@ discard block |
||
| 2630 | 2630 | |
| 2631 | 2631 | $ver = $default; |
| 2632 | 2632 | |
| 2633 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
| 2633 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
| 2634 | 2634 | return $ver; |
| 2635 | 2635 | } |
| 2636 | 2636 | |
| 2637 | - $query = $wp_scripts->registered[ $handle ]; |
|
| 2637 | + $query = $wp_scripts->registered[$handle]; |
|
| 2638 | 2638 | |
| 2639 | 2639 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
| 2640 | 2640 | $ver = $query->ver; |
@@ -2652,7 +2652,7 @@ discard block |
||
| 2652 | 2652 | * @return string|null |
| 2653 | 2653 | */ |
| 2654 | 2654 | public static function js_redirect( $url, $echo = false ) { |
| 2655 | - $callback = function () use ( $url ) { |
|
| 2655 | + $callback = function() use ( $url ) { |
|
| 2656 | 2656 | echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>'; |
| 2657 | 2657 | }; |
| 2658 | 2658 | return self::clip( $callback, $echo ); |
@@ -2755,7 +2755,7 @@ discard block |
||
| 2755 | 2755 | $suffix = 2; |
| 2756 | 2756 | do { |
| 2757 | 2757 | $key_check = $key . $separator . $suffix; |
| 2758 | - ++$suffix; |
|
| 2758 | + ++ $suffix; |
|
| 2759 | 2759 | } while ( in_array( $key_check, $similar_keys, true ) ); |
| 2760 | 2760 | |
| 2761 | 2761 | $key = $key_check; |
@@ -2872,7 +2872,7 @@ discard block |
||
| 2872 | 2872 | |
| 2873 | 2873 | foreach ( array( 'name', 'description' ) as $var ) { |
| 2874 | 2874 | $default_val = $record->{$var} ?? ''; |
| 2875 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
| 2875 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
| 2876 | 2876 | unset( $var, $default_val ); |
| 2877 | 2877 | } |
| 2878 | 2878 | |
@@ -2945,10 +2945,10 @@ discard block |
||
| 2945 | 2945 | $meta_value = FrmEntryMeta::get_meta_value( $record, $field->id ); |
| 2946 | 2946 | }//end if |
| 2947 | 2947 | |
| 2948 | - $field_type = $post_values['field_options'][ 'type_' . $field->id ] ?? $field->type; |
|
| 2948 | + $field_type = $post_values['field_options']['type_' . $field->id] ?? $field->type; |
|
| 2949 | 2949 | |
| 2950 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
| 2951 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
| 2950 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
| 2951 | + $new_value = $post_values['item_meta'][$field->id]; |
|
| 2952 | 2952 | self::unserialize_or_decode( $new_value ); |
| 2953 | 2953 | } else { |
| 2954 | 2954 | $new_value = $meta_value; |
@@ -2969,7 +2969,7 @@ discard block |
||
| 2969 | 2969 | |
| 2970 | 2970 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
| 2971 | 2971 | |
| 2972 | - $values['fields'][ $field->id ] = $field_array; |
|
| 2972 | + $values['fields'][$field->id] = $field_array; |
|
| 2973 | 2973 | } |
| 2974 | 2974 | |
| 2975 | 2975 | /** |
@@ -3019,11 +3019,11 @@ discard block |
||
| 3019 | 3019 | } |
| 3020 | 3020 | |
| 3021 | 3021 | foreach ( $form->options as $opt => $value ) { |
| 3022 | - if ( isset( $post_values[ $opt ] ) ) { |
|
| 3023 | - $values[ $opt ] = $post_values[ $opt ]; |
|
| 3024 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
| 3022 | + if ( isset( $post_values[$opt] ) ) { |
|
| 3023 | + $values[$opt] = $post_values[$opt]; |
|
| 3024 | + self::unserialize_or_decode( $values[$opt] ); |
|
| 3025 | 3025 | } else { |
| 3026 | - $values[ $opt ] = $value; |
|
| 3026 | + $values[$opt] = $value; |
|
| 3027 | 3027 | } |
| 3028 | 3028 | } |
| 3029 | 3029 | |
@@ -3042,8 +3042,8 @@ discard block |
||
| 3042 | 3042 | $form_defaults = FrmFormsHelper::get_default_opts(); |
| 3043 | 3043 | |
| 3044 | 3044 | foreach ( $form_defaults as $opt => $default ) { |
| 3045 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
| 3046 | - $values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default; |
|
| 3045 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
| 3046 | + $values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default; |
|
| 3047 | 3047 | } |
| 3048 | 3048 | |
| 3049 | 3049 | unset( $opt, $default ); |
@@ -3054,8 +3054,8 @@ discard block |
||
| 3054 | 3054 | } |
| 3055 | 3055 | |
| 3056 | 3056 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
| 3057 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
| 3058 | - $values[ $h . '_html' ] = ( $post_values['options'][ $h . '_html' ] ?? FrmFormsHelper::get_default_html( $h ) ); |
|
| 3057 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
| 3058 | + $values[$h . '_html'] = ( $post_values['options'][$h . '_html'] ?? FrmFormsHelper::get_default_html( $h ) ); |
|
| 3059 | 3059 | } |
| 3060 | 3060 | unset( $h ); |
| 3061 | 3061 | } |
@@ -3279,12 +3279,12 @@ discard block |
||
| 3279 | 3279 | // Show time in specified unit. |
| 3280 | 3280 | $levels = self::get_unit( $levels ); |
| 3281 | 3281 | |
| 3282 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
| 3282 | + if ( isset( $time_strings[$levels] ) ) { |
|
| 3283 | 3283 | $diff = array( |
| 3284 | 3284 | $levels => self::time_format( $levels, $diff ), |
| 3285 | 3285 | ); |
| 3286 | 3286 | $time_strings = array( |
| 3287 | - $levels => $time_strings[ $levels ], |
|
| 3287 | + $levels => $time_strings[$levels], |
|
| 3288 | 3288 | ); |
| 3289 | 3289 | } |
| 3290 | 3290 | |
@@ -3292,13 +3292,13 @@ discard block |
||
| 3292 | 3292 | } |
| 3293 | 3293 | |
| 3294 | 3294 | foreach ( $time_strings as $k => $v ) { |
| 3295 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
| 3296 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
| 3297 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
| 3295 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
| 3296 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
| 3297 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
| 3298 | 3298 | // Account for 0. |
| 3299 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
| 3299 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
| 3300 | 3300 | } else { |
| 3301 | - unset( $time_strings[ $k ] ); |
|
| 3301 | + unset( $time_strings[$k] ); |
|
| 3302 | 3302 | } |
| 3303 | 3303 | } |
| 3304 | 3304 | |
@@ -3323,8 +3323,8 @@ discard block |
||
| 3323 | 3323 | 'd' => 'days', |
| 3324 | 3324 | ); |
| 3325 | 3325 | |
| 3326 | - if ( isset( $return[ $unit ] ) ) { |
|
| 3327 | - return $diff[ $return[ $unit ] ]; |
|
| 3326 | + if ( isset( $return[$unit] ) ) { |
|
| 3327 | + return $diff[$return[$unit]]; |
|
| 3328 | 3328 | } |
| 3329 | 3329 | |
| 3330 | 3330 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -3332,11 +3332,11 @@ discard block |
||
| 3332 | 3332 | $times = array( 'h', 'i', 's' ); |
| 3333 | 3333 | |
| 3334 | 3334 | foreach ( $times as $time ) { |
| 3335 | - if ( ! isset( $diff[ $time ] ) ) { |
|
| 3335 | + if ( ! isset( $diff[$time] ) ) { |
|
| 3336 | 3336 | continue; |
| 3337 | 3337 | } |
| 3338 | 3338 | |
| 3339 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
| 3339 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
| 3340 | 3340 | } |
| 3341 | 3341 | |
| 3342 | 3342 | return floor( $total ); |
@@ -3361,7 +3361,7 @@ discard block |
||
| 3361 | 3361 | 'y' => DAY_IN_SECONDS * 365.25, |
| 3362 | 3362 | ); |
| 3363 | 3363 | |
| 3364 | - return $convert[ $from ] / $convert[ $to ]; |
|
| 3364 | + return $convert[$from] / $convert[$to]; |
|
| 3365 | 3365 | } |
| 3366 | 3366 | |
| 3367 | 3367 | /** |
@@ -3374,7 +3374,7 @@ discard block |
||
| 3374 | 3374 | private static function get_unit( $unit ) { |
| 3375 | 3375 | $units = self::get_time_strings(); |
| 3376 | 3376 | |
| 3377 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
| 3377 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
| 3378 | 3378 | return $unit; |
| 3379 | 3379 | } |
| 3380 | 3380 | |
@@ -3498,17 +3498,17 @@ discard block |
||
| 3498 | 3498 | |
| 3499 | 3499 | case 1: |
| 3500 | 3500 | $l2 = $name; |
| 3501 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
| 3501 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
| 3502 | 3502 | break; |
| 3503 | 3503 | |
| 3504 | 3504 | case 2: |
| 3505 | 3505 | $l3 = $name; |
| 3506 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
| 3506 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
| 3507 | 3507 | break; |
| 3508 | 3508 | |
| 3509 | 3509 | case 3: |
| 3510 | 3510 | $l4 = $name; |
| 3511 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
| 3511 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
| 3512 | 3512 | } |
| 3513 | 3513 | |
| 3514 | 3514 | unset( $this_val, $n ); |
@@ -3531,8 +3531,8 @@ discard block |
||
| 3531 | 3531 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
| 3532 | 3532 | if ( $name == '' ) { |
| 3533 | 3533 | $vars[] = $val; |
| 3534 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
| 3535 | - $vars[ $l1 ] = $val; |
|
| 3534 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
| 3535 | + $vars[$l1] = $val; |
|
| 3536 | 3536 | } |
| 3537 | 3537 | } |
| 3538 | 3538 | |
@@ -3556,7 +3556,7 @@ discard block |
||
| 3556 | 3556 | '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' ), |
| 3557 | 3557 | ); |
| 3558 | 3558 | |
| 3559 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
| 3559 | + if ( ! isset( $tooltips[$name] ) ) { |
|
| 3560 | 3560 | return; |
| 3561 | 3561 | } |
| 3562 | 3562 | |
@@ -3566,7 +3566,7 @@ discard block |
||
| 3566 | 3566 | echo ' class="frm_help"'; |
| 3567 | 3567 | } |
| 3568 | 3568 | |
| 3569 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
| 3569 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
| 3570 | 3570 | |
| 3571 | 3571 | if ( 'open' != $class ) { |
| 3572 | 3572 | echo '"'; |
@@ -3639,13 +3639,13 @@ discard block |
||
| 3639 | 3639 | * @return void |
| 3640 | 3640 | */ |
| 3641 | 3641 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
| 3642 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
| 3642 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
| 3643 | 3643 | return; |
| 3644 | 3644 | } |
| 3645 | 3645 | |
| 3646 | 3646 | if ( is_array( $val ) ) { |
| 3647 | 3647 | foreach ( $val as $k1 => $v1 ) { |
| 3648 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
| 3648 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
| 3649 | 3649 | unset( $k1, $v1 ); |
| 3650 | 3650 | } |
| 3651 | 3651 | } else { |
@@ -3653,7 +3653,7 @@ discard block |
||
| 3653 | 3653 | $val = stripslashes( $val ); |
| 3654 | 3654 | |
| 3655 | 3655 | // Add backslashes before double quotes and forward slashes only |
| 3656 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
| 3656 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
| 3657 | 3657 | } |
| 3658 | 3658 | } |
| 3659 | 3659 | |
@@ -3789,14 +3789,14 @@ discard block |
||
| 3789 | 3789 | |
| 3790 | 3790 | $key = $input['name']; |
| 3791 | 3791 | |
| 3792 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 3793 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 3794 | - $formatted[ $key ][] = $input['value']; |
|
| 3792 | + if ( isset( $formatted[$key] ) ) { |
|
| 3793 | + if ( is_array( $formatted[$key] ) ) { |
|
| 3794 | + $formatted[$key][] = $input['value']; |
|
| 3795 | 3795 | } else { |
| 3796 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 3796 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 3797 | 3797 | } |
| 3798 | 3798 | } else { |
| 3799 | - $formatted[ $key ] = $input['value']; |
|
| 3799 | + $formatted[$key] = $input['value']; |
|
| 3800 | 3800 | } |
| 3801 | 3801 | } |
| 3802 | 3802 | |
@@ -4527,8 +4527,8 @@ discard block |
||
| 4527 | 4527 | } |
| 4528 | 4528 | |
| 4529 | 4529 | foreach ( $keys as $key ) { |
| 4530 | - if ( isset( $values[ $key ] ) ) { |
|
| 4531 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
| 4530 | + if ( isset( $values[$key] ) ) { |
|
| 4531 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
| 4532 | 4532 | } |
| 4533 | 4533 | } |
| 4534 | 4534 | |
@@ -4595,7 +4595,7 @@ discard block |
||
| 4595 | 4595 | 'role', |
| 4596 | 4596 | 'style', |
| 4597 | 4597 | ); |
| 4598 | - $safe = in_array( $key, $safe_keys, true ); |
|
| 4598 | + $safe = in_array( $key, $safe_keys, true ); |
|
| 4599 | 4599 | }//end if |
| 4600 | 4600 | |
| 4601 | 4601 | /** |
@@ -4743,7 +4743,7 @@ discard block |
||
| 4743 | 4743 | return 0; |
| 4744 | 4744 | } |
| 4745 | 4745 | |
| 4746 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
| 4746 | + return strlen( $parts[count( $parts ) - 1] ); |
|
| 4747 | 4747 | } |
| 4748 | 4748 | |
| 4749 | 4749 | /** |
@@ -4763,7 +4763,7 @@ discard block |
||
| 4763 | 4763 | |
| 4764 | 4764 | add_filter( |
| 4765 | 4765 | 'option_gmt_offset', |
| 4766 | - function ( $offset ) { |
|
| 4766 | + function( $offset ) { |
|
| 4767 | 4767 | if ( ! is_string( $offset ) || is_numeric( $offset ) ) { |
| 4768 | 4768 | // Leave a valid value alone. |
| 4769 | 4769 | return $offset; |
@@ -4865,7 +4865,7 @@ discard block |
||
| 4865 | 4865 | return; |
| 4866 | 4866 | } |
| 4867 | 4867 | |
| 4868 | - $ajax_callback = function () use ( $option ) { |
|
| 4868 | + $ajax_callback = function() use ( $option ) { |
|
| 4869 | 4869 | self::dismiss_warning_message( $option ); |
| 4870 | 4870 | }; |
| 4871 | 4871 | |
@@ -4875,7 +4875,7 @@ discard block |
||
| 4875 | 4875 | |
| 4876 | 4876 | add_filter( |
| 4877 | 4877 | 'frm_message_list', |
| 4878 | - function ( $show_messages ) use ( $message, $option ) { |
|
| 4878 | + function( $show_messages ) use ( $message, $option ) { |
|
| 4879 | 4879 | if ( get_option( $option, false ) ) { |
| 4880 | 4880 | return $show_messages; |
| 4881 | 4881 | } |
@@ -751,7 +751,8 @@ discard block |
||
| 751 | 751 | if ( $src === 'get' ) { |
| 752 | 752 | $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 |
| 753 | 753 | |
| 754 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 754 | + if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { |
|
| 755 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 755 | 756 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 756 | 757 | $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
| 757 | 758 | } |
@@ -850,7 +851,8 @@ discard block |
||
| 850 | 851 | $value = wp_unslash( $_GET[ $args['param'] ] ); |
| 851 | 852 | } |
| 852 | 853 | } elseif ( $args['type'] === 'post' ) { |
| 853 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 854 | + if ( isset( $_POST[ $args['param'] ] ) ) { |
|
| 855 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 854 | 856 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 855 | 857 | $value = wp_unslash( $_POST[ $args['param'] ] ); |
| 856 | 858 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $page = $this->get_pagenum(); |
| 33 | 33 | $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' ); |
| 34 | 34 | |
| 35 | - $mode = self::get_param( |
|
| 35 | + $mode = self::get_param( |
|
| 36 | 36 | array( |
| 37 | 37 | 'param' => 'mode', |
| 38 | 38 | 'default' => 'list', |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | 'default' => 'name', |
| 45 | 45 | ) |
| 46 | 46 | ); |
| 47 | - $order = self::get_param( |
|
| 47 | + $order = self::get_param( |
|
| 48 | 48 | array( |
| 49 | 49 | 'param' => 'order', |
| 50 | 50 | 'default' => 'ASC', |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | FrmAppController::apply_saved_sort_preference( $orderby, $order ); |
| 55 | 55 | |
| 56 | - $start = self::get_param( |
|
| 56 | + $start = self::get_param( |
|
| 57 | 57 | array( |
| 58 | 58 | 'param' => 'start', |
| 59 | 59 | 'default' => ( $page - 1 ) * $per_page, |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $counts = FrmForm::get_count(); |
| 190 | 190 | $form_type = FrmAppHelper::simple_get( 'form_type', 'sanitize_title', 'published' ); |
| 191 | 191 | |
| 192 | - if ( isset( $statuses[ $form_type ] ) ) { |
|
| 192 | + if ( isset( $statuses[$form_type] ) ) { |
|
| 193 | 193 | $counts->$form_type = $this->total_items; |
| 194 | 194 | } |
| 195 | 195 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | |
| 211 | 211 | if ( $counts->{$status} || 'draft' !== $status ) { |
| 212 | 212 | /* translators: %1$s: Status, %2$s: Number of items */ |
| 213 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 213 | + $links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | unset( $status, $name ); |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $new_actions = FrmFormsHelper::get_action_links( $item->id, $item ); |
| 422 | 422 | |
| 423 | 423 | foreach ( $new_actions as $link => $action ) { |
| 424 | - $new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
| 424 | + $new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | if ( 'trash' === $this->status ) { |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | public static function get_current_action_from_global_var( $form_id ) { |
| 91 | 91 | global $frm_vars; |
| 92 | 92 | |
| 93 | - return $frm_vars['form_params'][ $form_id ]['action'] ?? 'create'; |
|
| 93 | + return $frm_vars['form_params'][$form_id]['action'] ?? 'create'; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | public static function remove_submit_field_from_list( &$fields ) { |
| 190 | 190 | foreach ( $fields as $key => $field ) { |
| 191 | 191 | if ( self::FIELD_TYPE === FrmField::get_field_type( $field ) ) { |
| 192 | - unset( $fields[ $key ] ); |
|
| 192 | + unset( $fields[$key] ); |
|
| 193 | 193 | return; |
| 194 | 194 | } |
| 195 | 195 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | ); |
| 246 | 246 | |
| 247 | 247 | if ( false !== $updated ) { |
| 248 | - self::$last_row_fields_order[ $last_row_field_id ] = $new_order; |
|
| 248 | + self::$last_row_fields_order[$last_row_field_id] = $new_order; |
|
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | 'class' => '', |
| 53 | 53 | 'inc_children' => 'exclude', |
| 54 | 54 | ); |
| 55 | - $args = wp_parse_args( $args, $defaults ); |
|
| 55 | + $args = wp_parse_args( $args, $defaults ); |
|
| 56 | 56 | |
| 57 | 57 | if ( ! $args['field_id'] ) { |
| 58 | 58 | $args['field_id'] = $field_name; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public static function add_html_attr( $class, $param, &$add_html ) { |
| 99 | 99 | if ( ! empty( $class ) ) { |
| 100 | - $add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 100 | + $add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
@@ -365,8 +365,8 @@ discard block |
||
| 365 | 365 | ); |
| 366 | 366 | |
| 367 | 367 | foreach ( $defaults as $var => $default ) { |
| 368 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 369 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 368 | + if ( ! isset( $values[$var] ) ) { |
|
| 369 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | |
@@ -382,8 +382,8 @@ discard block |
||
| 382 | 382 | ); |
| 383 | 383 | |
| 384 | 384 | foreach ( $defaults as $var => $default ) { |
| 385 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 386 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 385 | + if ( ! isset( $values[$var] ) ) { |
|
| 386 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 387 | 387 | } |
| 388 | 388 | } |
| 389 | 389 | unset( $defaults ); |
@@ -434,16 +434,16 @@ discard block |
||
| 434 | 434 | |
| 435 | 435 | foreach ( $defaults as $var => $default ) { |
| 436 | 436 | if ( is_array( $default ) ) { |
| 437 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 438 | - $values[ $var ] = $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : array(); |
|
| 437 | + if ( ! isset( $values[$var] ) ) { |
|
| 438 | + $values[$var] = $record && isset( $record->options[$var] ) ? $record->options[$var] : array(); |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | foreach ( $default as $k => $v ) { |
| 442 | - $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 ); |
|
| 442 | + $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 ); |
|
| 443 | 443 | |
| 444 | 444 | if ( is_array( $v ) ) { |
| 445 | 445 | foreach ( $v as $k1 => $v1 ) { |
| 446 | - $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 ); |
|
| 446 | + $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 ); |
|
| 447 | 447 | unset( $k1, $v1 ); |
| 448 | 448 | } |
| 449 | 449 | } |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | unset( $k, $v ); |
| 452 | 452 | } |
| 453 | 453 | } else { |
| 454 | - $values[ $var ] = $post_values && isset( $post_values['options'][ $var ] ) ? $post_values['options'][ $var ] : ( $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : $default ); |
|
| 454 | + $values[$var] = $post_values && isset( $post_values['options'][$var] ) ? $post_values['options'][$var] : ( $record && isset( $record->options[$var] ) ? $record->options[$var] : $default ); |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | unset( $var, $default ); |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | $defaults = self::get_default_opts(); |
| 501 | 501 | |
| 502 | 502 | foreach ( $defaults as $var => $default ) { |
| 503 | - $options[ $var ] = $values['options'][ $var ] ?? $default; |
|
| 503 | + $options[$var] = $values['options'][$var] ?? $default; |
|
| 504 | 504 | unset( $var, $default ); |
| 505 | 505 | } |
| 506 | 506 | } |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | public static function insert_opt_html( $args ) { |
| 700 | 700 | $class = $args['class'] ?? ''; |
| 701 | 701 | $fields = self::get_field_type_data_for_insert_opt_html(); |
| 702 | - $field = $fields[ $args['type'] ] ?? array(); |
|
| 702 | + $field = $fields[$args['type']] ?? array(); |
|
| 703 | 703 | |
| 704 | 704 | self::prepare_field_type( $field ); |
| 705 | 705 | |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | |
| 841 | 841 | foreach ( $fields as $field ) { |
| 842 | 842 | if ( $prev_order === $field->field_order ) { |
| 843 | - ++$add_order; |
|
| 843 | + ++ $add_order; |
|
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | if ( $add_order ) { |
@@ -1391,9 +1391,9 @@ discard block |
||
| 1391 | 1391 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
| 1392 | 1392 | } |
| 1393 | 1393 | |
| 1394 | - $label = ( $link_details[ $length ] ?? $link_details['label'] ); |
|
| 1394 | + $label = ( $link_details[$length] ?? $link_details['label'] ); |
|
| 1395 | 1395 | |
| 1396 | - if ( $length === 'icon' && isset( $link_details[ $length ] ) ) { |
|
| 1396 | + if ( $length === 'icon' && isset( $link_details[$length] ) ) { |
|
| 1397 | 1397 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
| 1398 | 1398 | $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
| 1399 | 1399 | } |
@@ -1565,7 +1565,7 @@ discard block |
||
| 1565 | 1565 | $status = 'publish'; |
| 1566 | 1566 | } |
| 1567 | 1567 | |
| 1568 | - $name = $nice_names[ $status ]; |
|
| 1568 | + $name = $nice_names[$status]; |
|
| 1569 | 1569 | |
| 1570 | 1570 | return $name; |
| 1571 | 1571 | } |
@@ -1631,7 +1631,7 @@ discard block |
||
| 1631 | 1631 | |
| 1632 | 1632 | if ( count( $categories ) === 1 ) { |
| 1633 | 1633 | $category = reset( $categories ); |
| 1634 | - $icon = $icons[ $category ] ?? $icon; |
|
| 1634 | + $icon = $icons[$category] ?? $icon; |
|
| 1635 | 1635 | } elseif ( ! empty( $categories ) ) { |
| 1636 | 1636 | $icons = array_intersect_key( $icons, array_flip( $categories ) ); |
| 1637 | 1637 | $icon = reset( $icons ); |
@@ -1763,7 +1763,7 @@ discard block |
||
| 1763 | 1763 | |
| 1764 | 1764 | foreach ( $item['categories'] as $k => $category ) { |
| 1765 | 1765 | if ( in_array( $category, $plans, true ) ) { |
| 1766 | - unset( $item['categories'][ $k ] ); |
|
| 1766 | + unset( $item['categories'][$k] ); |
|
| 1767 | 1767 | |
| 1768 | 1768 | $category = self::convert_legacy_package_names( $category ); |
| 1769 | 1769 | |
@@ -1805,7 +1805,7 @@ discard block |
||
| 1805 | 1805 | 'include_all' => true, |
| 1806 | 1806 | 'case_lower' => false, |
| 1807 | 1807 | ); |
| 1808 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1808 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1809 | 1809 | |
| 1810 | 1810 | $license_types = array( 'Basic', 'Plus', 'Business', 'Elite' ); |
| 1811 | 1811 | |
@@ -2012,9 +2012,9 @@ discard block |
||
| 2012 | 2012 | } |
| 2013 | 2013 | |
| 2014 | 2014 | foreach ( $shortcodes[0] as $key => $shortcode ) { |
| 2015 | - $options = trim( $shortcodes[3][ $key ] ); |
|
| 2015 | + $options = trim( $shortcodes[3][$key] ); |
|
| 2016 | 2016 | |
| 2017 | - if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) { |
|
| 2017 | + if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) { |
|
| 2018 | 2018 | // Skip if shortcodes. |
| 2019 | 2019 | continue; |
| 2020 | 2020 | } |
@@ -2024,7 +2024,7 @@ discard block |
||
| 2024 | 2024 | continue; |
| 2025 | 2025 | } |
| 2026 | 2026 | |
| 2027 | - $new_shortcode = '[' . $shortcodes[2][ $key ]; |
|
| 2027 | + $new_shortcode = '[' . $shortcodes[2][$key]; |
|
| 2028 | 2028 | |
| 2029 | 2029 | if ( $options ) { |
| 2030 | 2030 | $new_shortcode .= ' ' . $options; |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | $sections = array( 'counters', 'license', 'get_free_templates', 'payments', 'entries', 'inbox', 'video', 'payments' ); |
| 91 | 91 | |
| 92 | 92 | foreach ( $sections as $section ) { |
| 93 | - if ( isset( $data[ $section ] ) ) { |
|
| 94 | - $this->view[ $section ] = $data[ $section ]; |
|
| 93 | + if ( isset( $data[$section] ) ) { |
|
| 94 | + $this->view[$section] = $data[$section]; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | private static function load_entries_list_template( $template ) { |
| 372 | 372 | add_filter( |
| 373 | 373 | 'formidable_page_formidable_entries_per_page', |
| 374 | - function () { |
|
| 374 | + function() { |
|
| 375 | 375 | return 7; |
| 376 | 376 | } |
| 377 | 377 | ); |
@@ -254,11 +254,11 @@ discard block |
||
| 254 | 254 | public static function get_last_sent_date( $type ) { |
| 255 | 255 | $options = self::get_options(); |
| 256 | 256 | |
| 257 | - if ( empty( $options[ 'last_' . $type ] ) ) { |
|
| 257 | + if ( empty( $options['last_' . $type] ) ) { |
|
| 258 | 258 | return false; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - return $options[ 'last_' . $type ]; |
|
| 261 | + return $options['last_' . $type]; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /** |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | public static function set_last_sent_date( $type, $value = null ) { |
| 273 | 273 | $options = self::get_options(); |
| 274 | 274 | |
| 275 | - $options[ 'last_' . $type ] = null === $value ? self::get_date_from_today() : ''; |
|
| 275 | + $options['last_' . $type] = null === $value ? self::get_date_from_today() : ''; |
|
| 276 | 276 | self::save_options( $options ); |
| 277 | 277 | } |
| 278 | 278 | |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | $currency = strtoupper( $currency ); |
| 19 | 19 | $currencies = self::get_currencies(); |
| 20 | 20 | |
| 21 | - if ( isset( $currencies[ $currency ] ) ) { |
|
| 22 | - $currency = $currencies[ $currency ]; |
|
| 23 | - } elseif ( isset( $currencies[ strtolower( $currency ) ] ) ) { |
|
| 24 | - $currency = $currencies[ strtolower( $currency ) ]; |
|
| 21 | + if ( isset( $currencies[$currency] ) ) { |
|
| 22 | + $currency = $currencies[$currency]; |
|
| 23 | + } elseif ( isset( $currencies[strtolower( $currency )] ) ) { |
|
| 24 | + $currency = $currencies[strtolower( $currency )]; |
|
| 25 | 25 | } else { |
| 26 | 26 | $currency = $currencies['USD']; |
| 27 | 27 | } |
@@ -134,12 +134,12 @@ |
||
| 134 | 134 | |
| 135 | 135 | $val = array(); |
| 136 | 136 | |
| 137 | - for ( $i = 0; $i < $count; $i++ ) { |
|
| 137 | + for ( $i = 0; $i < $count; $i ++ ) { |
|
| 138 | 138 | $array_key = $this->do_parse( $string ); |
| 139 | 139 | $array_value = $this->do_parse( $string ); |
| 140 | 140 | |
| 141 | 141 | if ( ! is_array( $array_key ) ) { |
| 142 | - $val[ $array_key ] = $array_value; |
|
| 142 | + $val[$array_key] = $array_value; |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $result = array(); |
| 78 | 78 | |
| 79 | 79 | foreach ( $contextual_shortcodes as $type => $shortcodes ) { |
| 80 | - $result[ $type ] = array_keys( $shortcodes ); |
|
| 80 | + $result[$type] = array_keys( $shortcodes ); |
|
| 81 | 81 | } |
| 82 | 82 | return $result; |
| 83 | 83 | } |
@@ -119,8 +119,8 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | $with_tags = $args['conditional_check'] ? 3 : 2; |
| 121 | 121 | |
| 122 | - if ( ! empty( $shortcodes[ $with_tags ][ $short_key ] ) ) { |
|
| 123 | - $tag = str_replace( '[' . $prefix, '', $shortcodes[0][ $short_key ] ); |
|
| 122 | + if ( ! empty( $shortcodes[$with_tags][$short_key] ) ) { |
|
| 123 | + $tag = str_replace( '[' . $prefix, '', $shortcodes[0][$short_key] ); |
|
| 124 | 124 | $tag = str_replace( ']', '', $tag ); |
| 125 | 125 | $tag = str_replace( chr( 194 ) . chr( 160 ), ' ', $tag ); |
| 126 | 126 | $tags = preg_split( '/\s+/', $tag, 2 ); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $tag = $tags[0]; |
| 130 | 130 | } |
| 131 | 131 | } else { |
| 132 | - $tag = $shortcodes[ $with_tags - 1 ][ $short_key ]; |
|
| 132 | + $tag = $shortcodes[$with_tags - 1][$short_key]; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | return $tag; |