@@ -8,14 +8,14 @@ |
||
8 | 8 | if ( method_exists( 'FrmAppHelper', 'maybe_autocomplete_options' ) ) { |
9 | 9 | $posts = get_posts( |
10 | 10 | array( |
11 | - 'posts_per_page' => -1, |
|
11 | + 'posts_per_page' => - 1, |
|
12 | 12 | 'post_type' => 'any', |
13 | 13 | 'order' => 'DESC', |
14 | 14 | ) |
15 | 15 | ); |
16 | 16 | $source = array(); |
17 | 17 | foreach ( $posts as $post ) { |
18 | - $source[ $post->ID ] = $post->post_title; |
|
18 | + $source[$post->ID] = $post->post_title; |
|
19 | 19 | } |
20 | 20 | FrmAppHelper::maybe_autocomplete_options( array( |
21 | 21 | 'source' => $source, |
@@ -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"/> |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | * @return string |
476 | 476 | */ |
477 | 477 | public static function get_server_value( $value ) { |
478 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
478 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | /** |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | $ip = ''; |
510 | 510 | |
511 | 511 | foreach ( $ip_options as $key ) { |
512 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
512 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
513 | 513 | continue; |
514 | 514 | } |
515 | 515 | |
@@ -578,10 +578,10 @@ discard block |
||
578 | 578 | } |
579 | 579 | |
580 | 580 | if ( $src === 'get' ) { |
581 | - $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 |
|
582 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
581 | + $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 |
|
582 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
583 | 583 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
584 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
584 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
585 | 585 | } |
586 | 586 | self::sanitize_value( $sanitize, $value ); |
587 | 587 | } else { |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | } |
603 | 603 | |
604 | 604 | $p = trim( $p, ']' ); |
605 | - $value = isset( $value[ $p ] ) ? $value[ $p ] : $default; |
|
605 | + $value = isset( $value[$p] ) ? $value[$p] : $default; |
|
606 | 606 | } |
607 | 607 | } |
608 | 608 | |
@@ -667,26 +667,26 @@ discard block |
||
667 | 667 | 'sanitize' => 'sanitize_text_field', |
668 | 668 | 'serialized' => false, |
669 | 669 | ); |
670 | - $args = wp_parse_args( $args, $defaults ); |
|
670 | + $args = wp_parse_args( $args, $defaults ); |
|
671 | 671 | |
672 | 672 | $value = $args['default']; |
673 | 673 | if ( $args['type'] === 'get' ) { |
674 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
674 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
675 | 675 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
676 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
676 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
677 | 677 | } |
678 | 678 | } elseif ( $args['type'] === 'post' ) { |
679 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
679 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
680 | 680 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
681 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
681 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
682 | 682 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
683 | 683 | self::unserialize_or_decode( $value ); |
684 | 684 | } |
685 | 685 | } |
686 | - } elseif ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
686 | + } elseif ( isset( $_REQUEST[$args['param']] ) ) { |
|
687 | 687 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
688 | 688 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
689 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
689 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
690 | 690 | } |
691 | 691 | |
692 | 692 | self::sanitize_value( $args['sanitize'], $value ); |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | if ( is_array( $value ) ) { |
734 | 734 | $temp_values = $value; |
735 | 735 | foreach ( $temp_values as $k => $v ) { |
736 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
736 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
737 | 737 | } |
738 | 738 | return; |
739 | 739 | } |
@@ -744,8 +744,8 @@ discard block |
||
744 | 744 | public static function sanitize_request( $sanitize_method, &$values ) { |
745 | 745 | $temp_values = $values; |
746 | 746 | foreach ( $temp_values as $k => $val ) { |
747 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
748 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
747 | + if ( isset( $sanitize_method[$k] ) ) { |
|
748 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
749 | 749 | } |
750 | 750 | } |
751 | 751 | } |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | if ( is_array( $value ) ) { |
806 | 806 | $temp_values = $value; |
807 | 807 | foreach ( $temp_values as $k => $v ) { |
808 | - self::decode_specialchars( $value[ $k ] ); |
|
808 | + self::decode_specialchars( $value[$k] ); |
|
809 | 809 | } |
810 | 810 | } else { |
811 | 811 | self::decode_amp( $value ); |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | * @return array |
928 | 928 | */ |
929 | 929 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
930 | - $allowed_html['input'] = array( |
|
930 | + $allowed_html['input'] = array( |
|
931 | 931 | 'type' => true, |
932 | 932 | 'value' => true, |
933 | 933 | 'formnovalidate' => true, |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | $allowed_html = $html; |
951 | 951 | } elseif ( ! empty( $allowed ) ) { |
952 | 952 | foreach ( (array) $allowed as $a ) { |
953 | - $allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array(); |
|
953 | + $allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array(); |
|
954 | 954 | } |
955 | 955 | } |
956 | 956 | |
@@ -1129,8 +1129,8 @@ discard block |
||
1129 | 1129 | } |
1130 | 1130 | |
1131 | 1131 | global $wp_query; |
1132 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
1133 | - $value = $wp_query->query_vars[ $param ]; |
|
1132 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
1133 | + $value = $wp_query->query_vars[$param]; |
|
1134 | 1134 | } |
1135 | 1135 | |
1136 | 1136 | return $value; |
@@ -1161,9 +1161,9 @@ discard block |
||
1161 | 1161 | 'frm_keyalt_icon' => 'frm_key_icon', |
1162 | 1162 | 'frm_keyalt_solid_icon' => 'frm_key_solid_icon', |
1163 | 1163 | ); |
1164 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
1165 | - $icon = $deprecated[ $icon ]; |
|
1166 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
1164 | + if ( isset( $deprecated[$icon] ) ) { |
|
1165 | + $icon = $deprecated[$icon]; |
|
1166 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
1167 | 1167 | } |
1168 | 1168 | |
1169 | 1169 | if ( $icon === $class ) { |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | * @return string|void |
1286 | 1286 | */ |
1287 | 1287 | public static function array_to_html_params( $atts, $echo = false ) { |
1288 | - $callback = function () use ( $atts ) { |
|
1288 | + $callback = function() use ( $atts ) { |
|
1289 | 1289 | if ( $atts ) { |
1290 | 1290 | foreach ( $atts as $key => $value ) { |
1291 | 1291 | echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
@@ -1448,7 +1448,7 @@ discard block |
||
1448 | 1448 | 'input_id' => '', |
1449 | 1449 | 'value' => false, |
1450 | 1450 | ); |
1451 | - $atts = array_merge( $defaults, $atts ); |
|
1451 | + $atts = array_merge( $defaults, $atts ); |
|
1452 | 1452 | |
1453 | 1453 | if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) { |
1454 | 1454 | $atts['tosearch'] = 'frm-card'; |
@@ -1524,7 +1524,7 @@ discard block |
||
1524 | 1524 | 'new_file_path' => self::plugin_path() . '/js', |
1525 | 1525 | ) |
1526 | 1526 | ); |
1527 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1527 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1528 | 1528 | |
1529 | 1529 | $files = array( |
1530 | 1530 | self::plugin_path() . '/js/formidable.min.js', |
@@ -1696,7 +1696,7 @@ discard block |
||
1696 | 1696 | <input type="text" class="frm-custom-search" |
1697 | 1697 | data-source="<?php echo esc_attr( wp_json_encode( $options ) ); ?>" |
1698 | 1698 | placeholder="<?php echo esc_attr( $args['autocomplete_placeholder'] ); ?>" |
1699 | - value="<?php echo esc_attr( $args['source'][ $args['selected'] ] ); ?>" /> |
|
1699 | + value="<?php echo esc_attr( $args['source'][$args['selected']] ); ?>" /> |
|
1700 | 1700 | <input type="hidden" name="<?php echo esc_attr( $args['name'] ); ?>" |
1701 | 1701 | class="frm_autocomplete_value_input" |
1702 | 1702 | value="<?php echo esc_attr( $args['selected'] ); ?>" /> |
@@ -2078,8 +2078,8 @@ discard block |
||
2078 | 2078 | return $error; |
2079 | 2079 | } |
2080 | 2080 | |
2081 | - $nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
2082 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
2081 | + $nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
2082 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
2083 | 2083 | $frm_settings = self::get_settings(); |
2084 | 2084 | $error = $frm_settings->admin_permission; |
2085 | 2085 | } |
@@ -2115,7 +2115,7 @@ discard block |
||
2115 | 2115 | } else { |
2116 | 2116 | foreach ( $value as $k => $v ) { |
2117 | 2117 | if ( ! is_array( $v ) ) { |
2118 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
2118 | + $value[$k] = call_user_func( $original_function, $v ); |
|
2119 | 2119 | } |
2120 | 2120 | } |
2121 | 2121 | } |
@@ -2156,7 +2156,7 @@ discard block |
||
2156 | 2156 | if ( is_array( $value ) ) { |
2157 | 2157 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
2158 | 2158 | } elseif ( $keys === 'keep' ) { |
2159 | - $return[ $key ] = $value; |
|
2159 | + $return[$key] = $value; |
|
2160 | 2160 | } else { |
2161 | 2161 | $return[] = $value; |
2162 | 2162 | } |
@@ -2231,11 +2231,11 @@ discard block |
||
2231 | 2231 | } |
2232 | 2232 | |
2233 | 2233 | $ver = $default; |
2234 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
2234 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
2235 | 2235 | return $ver; |
2236 | 2236 | } |
2237 | 2237 | |
2238 | - $query = $wp_scripts->registered[ $handle ]; |
|
2238 | + $query = $wp_scripts->registered[$handle]; |
|
2239 | 2239 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
2240 | 2240 | $ver = $query->ver; |
2241 | 2241 | } |
@@ -2251,7 +2251,7 @@ discard block |
||
2251 | 2251 | * @return string|null |
2252 | 2252 | */ |
2253 | 2253 | public static function js_redirect( $url, $echo = false ) { |
2254 | - $callback = function () use ( $url ) { |
|
2254 | + $callback = function() use ( $url ) { |
|
2255 | 2255 | echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>'; |
2256 | 2256 | }; |
2257 | 2257 | return self::clip( $callback, $echo ); |
@@ -2346,7 +2346,7 @@ discard block |
||
2346 | 2346 | $suffix = 2; |
2347 | 2347 | do { |
2348 | 2348 | $key_check = $key . $separator . $suffix; |
2349 | - ++$suffix; |
|
2349 | + ++ $suffix; |
|
2350 | 2350 | } while ( in_array( $key_check, $similar_keys, true ) ); |
2351 | 2351 | |
2352 | 2352 | $key = $key_check; |
@@ -2454,7 +2454,7 @@ discard block |
||
2454 | 2454 | |
2455 | 2455 | foreach ( array( 'name', 'description' ) as $var ) { |
2456 | 2456 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
2457 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2457 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2458 | 2458 | unset( $var, $default_val ); |
2459 | 2459 | } |
2460 | 2460 | |
@@ -2510,9 +2510,9 @@ discard block |
||
2510 | 2510 | $meta_value = FrmEntryMeta::get_meta_value( $record, $field->id ); |
2511 | 2511 | }//end if |
2512 | 2512 | |
2513 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
2514 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
2515 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
2513 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
2514 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
2515 | + $new_value = $post_values['item_meta'][$field->id]; |
|
2516 | 2516 | self::unserialize_or_decode( $new_value ); |
2517 | 2517 | } else { |
2518 | 2518 | $new_value = $meta_value; |
@@ -2533,7 +2533,7 @@ discard block |
||
2533 | 2533 | |
2534 | 2534 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
2535 | 2535 | |
2536 | - $values['fields'][ $field->id ] = $field_array; |
|
2536 | + $values['fields'][$field->id] = $field_array; |
|
2537 | 2537 | } |
2538 | 2538 | |
2539 | 2539 | /** |
@@ -2583,11 +2583,11 @@ discard block |
||
2583 | 2583 | } |
2584 | 2584 | |
2585 | 2585 | foreach ( $form->options as $opt => $value ) { |
2586 | - if ( isset( $post_values[ $opt ] ) ) { |
|
2587 | - $values[ $opt ] = $post_values[ $opt ]; |
|
2588 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
2586 | + if ( isset( $post_values[$opt] ) ) { |
|
2587 | + $values[$opt] = $post_values[$opt]; |
|
2588 | + self::unserialize_or_decode( $values[$opt] ); |
|
2589 | 2589 | } else { |
2590 | - $values[ $opt ] = $value; |
|
2590 | + $values[$opt] = $value; |
|
2591 | 2591 | } |
2592 | 2592 | } |
2593 | 2593 | |
@@ -2601,8 +2601,8 @@ discard block |
||
2601 | 2601 | $form_defaults = FrmFormsHelper::get_default_opts(); |
2602 | 2602 | |
2603 | 2603 | foreach ( $form_defaults as $opt => $default ) { |
2604 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
2605 | - $values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default; |
|
2604 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
2605 | + $values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default; |
|
2606 | 2606 | } |
2607 | 2607 | |
2608 | 2608 | unset( $opt, $default ); |
@@ -2613,8 +2613,8 @@ discard block |
||
2613 | 2613 | } |
2614 | 2614 | |
2615 | 2615 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
2616 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
2617 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
2616 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
2617 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
2618 | 2618 | } |
2619 | 2619 | unset( $h ); |
2620 | 2620 | } |
@@ -2809,25 +2809,25 @@ discard block |
||
2809 | 2809 | if ( ! is_numeric( $levels ) ) { |
2810 | 2810 | // Show time in specified unit. |
2811 | 2811 | $levels = self::get_unit( $levels ); |
2812 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
2812 | + if ( isset( $time_strings[$levels] ) ) { |
|
2813 | 2813 | $diff = array( |
2814 | 2814 | $levels => self::time_format( $levels, $diff ), |
2815 | 2815 | ); |
2816 | 2816 | $time_strings = array( |
2817 | - $levels => $time_strings[ $levels ], |
|
2817 | + $levels => $time_strings[$levels], |
|
2818 | 2818 | ); |
2819 | 2819 | } |
2820 | 2820 | $levels = 1; |
2821 | 2821 | } |
2822 | 2822 | |
2823 | 2823 | foreach ( $time_strings as $k => $v ) { |
2824 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
2825 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
2826 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
2824 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
2825 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
2826 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
2827 | 2827 | // Account for 0. |
2828 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
2828 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
2829 | 2829 | } else { |
2830 | - unset( $time_strings[ $k ] ); |
|
2830 | + unset( $time_strings[$k] ); |
|
2831 | 2831 | } |
2832 | 2832 | } |
2833 | 2833 | |
@@ -2846,8 +2846,8 @@ discard block |
||
2846 | 2846 | 'y' => 'y', |
2847 | 2847 | 'd' => 'days', |
2848 | 2848 | ); |
2849 | - if ( isset( $return[ $unit ] ) ) { |
|
2850 | - return $diff[ $return[ $unit ] ]; |
|
2849 | + if ( isset( $return[$unit] ) ) { |
|
2850 | + return $diff[$return[$unit]]; |
|
2851 | 2851 | } |
2852 | 2852 | |
2853 | 2853 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -2855,11 +2855,11 @@ discard block |
||
2855 | 2855 | $times = array( 'h', 'i', 's' ); |
2856 | 2856 | |
2857 | 2857 | foreach ( $times as $time ) { |
2858 | - if ( ! isset( $diff[ $time ] ) ) { |
|
2858 | + if ( ! isset( $diff[$time] ) ) { |
|
2859 | 2859 | continue; |
2860 | 2860 | } |
2861 | 2861 | |
2862 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
2862 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
2863 | 2863 | } |
2864 | 2864 | |
2865 | 2865 | return floor( $total ); |
@@ -2879,7 +2879,7 @@ discard block |
||
2879 | 2879 | 'y' => DAY_IN_SECONDS * 365.25, |
2880 | 2880 | ); |
2881 | 2881 | |
2882 | - return $convert[ $from ] / $convert[ $to ]; |
|
2882 | + return $convert[$from] / $convert[$to]; |
|
2883 | 2883 | } |
2884 | 2884 | |
2885 | 2885 | /** |
@@ -2887,7 +2887,7 @@ discard block |
||
2887 | 2887 | */ |
2888 | 2888 | private static function get_unit( $unit ) { |
2889 | 2889 | $units = self::get_time_strings(); |
2890 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
2890 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
2891 | 2891 | return $unit; |
2892 | 2892 | } |
2893 | 2893 | |
@@ -3003,17 +3003,17 @@ discard block |
||
3003 | 3003 | |
3004 | 3004 | case 1: |
3005 | 3005 | $l2 = $name; |
3006 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
3006 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
3007 | 3007 | break; |
3008 | 3008 | |
3009 | 3009 | case 2: |
3010 | 3010 | $l3 = $name; |
3011 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
3011 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
3012 | 3012 | break; |
3013 | 3013 | |
3014 | 3014 | case 3: |
3015 | 3015 | $l4 = $name; |
3016 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
3016 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
3017 | 3017 | } |
3018 | 3018 | |
3019 | 3019 | unset( $this_val, $n ); |
@@ -3032,8 +3032,8 @@ discard block |
||
3032 | 3032 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
3033 | 3033 | if ( $name == '' ) { |
3034 | 3034 | $vars[] = $val; |
3035 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
3036 | - $vars[ $l1 ] = $val; |
|
3035 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
3036 | + $vars[$l1] = $val; |
|
3037 | 3037 | } |
3038 | 3038 | } |
3039 | 3039 | |
@@ -3050,7 +3050,7 @@ discard block |
||
3050 | 3050 | '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' ), |
3051 | 3051 | ); |
3052 | 3052 | |
3053 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
3053 | + if ( ! isset( $tooltips[$name] ) ) { |
|
3054 | 3054 | return; |
3055 | 3055 | } |
3056 | 3056 | |
@@ -3060,7 +3060,7 @@ discard block |
||
3060 | 3060 | echo ' class="frm_help"'; |
3061 | 3061 | } |
3062 | 3062 | |
3063 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
3063 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
3064 | 3064 | |
3065 | 3065 | if ( 'open' != $class ) { |
3066 | 3066 | echo '"'; |
@@ -3119,13 +3119,13 @@ discard block |
||
3119 | 3119 | } |
3120 | 3120 | |
3121 | 3121 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
3122 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
3122 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
3123 | 3123 | return; |
3124 | 3124 | } |
3125 | 3125 | |
3126 | 3126 | if ( is_array( $val ) ) { |
3127 | 3127 | foreach ( $val as $k1 => $v1 ) { |
3128 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
3128 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
3129 | 3129 | unset( $k1, $v1 ); |
3130 | 3130 | } |
3131 | 3131 | } else { |
@@ -3133,7 +3133,7 @@ discard block |
||
3133 | 3133 | $val = stripslashes( $val ); |
3134 | 3134 | |
3135 | 3135 | // Add backslashes before double quotes and forward slashes only |
3136 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
3136 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
3137 | 3137 | } |
3138 | 3138 | } |
3139 | 3139 | |
@@ -3254,14 +3254,14 @@ discard block |
||
3254 | 3254 | continue; |
3255 | 3255 | } |
3256 | 3256 | $key = $input['name']; |
3257 | - if ( isset( $formatted[ $key ] ) ) { |
|
3258 | - if ( is_array( $formatted[ $key ] ) ) { |
|
3259 | - $formatted[ $key ][] = $input['value']; |
|
3257 | + if ( isset( $formatted[$key] ) ) { |
|
3258 | + if ( is_array( $formatted[$key] ) ) { |
|
3259 | + $formatted[$key][] = $input['value']; |
|
3260 | 3260 | } else { |
3261 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
3261 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
3262 | 3262 | } |
3263 | 3263 | } else { |
3264 | - $formatted[ $key ] = $input['value']; |
|
3264 | + $formatted[$key] = $input['value']; |
|
3265 | 3265 | } |
3266 | 3266 | } |
3267 | 3267 | |
@@ -3969,8 +3969,8 @@ discard block |
||
3969 | 3969 | } |
3970 | 3970 | |
3971 | 3971 | foreach ( $keys as $key ) { |
3972 | - if ( isset( $values[ $key ] ) ) { |
|
3973 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
3972 | + if ( isset( $values[$key] ) ) { |
|
3973 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
3974 | 3974 | } |
3975 | 3975 | } |
3976 | 3976 | |
@@ -4035,7 +4035,7 @@ discard block |
||
4035 | 4035 | 'role', |
4036 | 4036 | 'style', |
4037 | 4037 | ); |
4038 | - $safe = in_array( $key, $safe_keys, true ); |
|
4038 | + $safe = in_array( $key, $safe_keys, true ); |
|
4039 | 4039 | }//end if |
4040 | 4040 | |
4041 | 4041 | /** |
@@ -4174,7 +4174,7 @@ discard block |
||
4174 | 4174 | return 0; |
4175 | 4175 | } |
4176 | 4176 | |
4177 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
4177 | + return strlen( $parts[count( $parts ) - 1] ); |
|
4178 | 4178 | } |
4179 | 4179 | |
4180 | 4180 | /** |
@@ -4194,7 +4194,7 @@ discard block |
||
4194 | 4194 | |
4195 | 4195 | add_filter( |
4196 | 4196 | 'option_gmt_offset', |
4197 | - function ( $offset ) { |
|
4197 | + function( $offset ) { |
|
4198 | 4198 | if ( ! is_string( $offset ) || is_numeric( $offset ) ) { |
4199 | 4199 | // Leave a valid value alone. |
4200 | 4200 | return $offset; |
@@ -4291,7 +4291,7 @@ discard block |
||
4291 | 4291 | return; |
4292 | 4292 | } |
4293 | 4293 | |
4294 | - $ajax_callback = function () use ( $option ) { |
|
4294 | + $ajax_callback = function() use ( $option ) { |
|
4295 | 4295 | self::dismiss_warning_message( $option ); |
4296 | 4296 | }; |
4297 | 4297 | |
@@ -4301,7 +4301,7 @@ discard block |
||
4301 | 4301 | |
4302 | 4302 | add_filter( |
4303 | 4303 | 'frm_message_list', |
4304 | - function ( $show_messages ) use ( $message, $option ) { |
|
4304 | + function( $show_messages ) use ( $message, $option ) { |
|
4305 | 4305 | if ( get_option( $option, false ) ) { |
4306 | 4306 | return $show_messages; |
4307 | 4307 | } |