@@ -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', |
@@ -1684,8 +1684,8 @@ discard block |
||
1684 | 1684 | <?php |
1685 | 1685 | foreach ( $args['source'] as $key => $source ) : |
1686 | 1686 | if ( is_array( $source ) ) { |
1687 | - $value = isset( $source[ $args['value_key'] ] ) ? $source[ $args['value_key'] ] : ''; |
|
1688 | - $label = isset( $source[ $args['label_key'] ] ) ? $source[ $args['label_key'] ] : ''; |
|
1687 | + $value = isset( $source[$args['value_key']] ) ? $source[$args['value_key']] : ''; |
|
1688 | + $label = isset( $source[$args['label_key']] ) ? $source[$args['label_key']] : ''; |
|
1689 | 1689 | } else { |
1690 | 1690 | $value = $key; |
1691 | 1691 | $label = $source; |
@@ -1700,8 +1700,8 @@ discard block |
||
1700 | 1700 | $autocomplete_value = ''; |
1701 | 1701 | foreach ( $args['source'] as $key => $source ) { |
1702 | 1702 | if ( is_array( $source ) ) { |
1703 | - $value = isset( $source[ $args['value_key'] ] ) ? $source[ $args['value_key'] ] : ''; |
|
1704 | - $label = isset( $source[ $args['label_key'] ] ) ? $source[ $args['label_key'] ] : ''; |
|
1703 | + $value = isset( $source[$args['value_key']] ) ? $source[$args['value_key']] : ''; |
|
1704 | + $label = isset( $source[$args['label_key']] ) ? $source[$args['label_key']] : ''; |
|
1705 | 1705 | } else { |
1706 | 1706 | $value = $key; |
1707 | 1707 | $label = $source; |
@@ -2099,8 +2099,8 @@ discard block |
||
2099 | 2099 | return $error; |
2100 | 2100 | } |
2101 | 2101 | |
2102 | - $nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
2103 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
2102 | + $nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
2103 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
2104 | 2104 | $frm_settings = self::get_settings(); |
2105 | 2105 | $error = $frm_settings->admin_permission; |
2106 | 2106 | } |
@@ -2136,7 +2136,7 @@ discard block |
||
2136 | 2136 | } else { |
2137 | 2137 | foreach ( $value as $k => $v ) { |
2138 | 2138 | if ( ! is_array( $v ) ) { |
2139 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
2139 | + $value[$k] = call_user_func( $original_function, $v ); |
|
2140 | 2140 | } |
2141 | 2141 | } |
2142 | 2142 | } |
@@ -2177,7 +2177,7 @@ discard block |
||
2177 | 2177 | if ( is_array( $value ) ) { |
2178 | 2178 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
2179 | 2179 | } elseif ( $keys === 'keep' ) { |
2180 | - $return[ $key ] = $value; |
|
2180 | + $return[$key] = $value; |
|
2181 | 2181 | } else { |
2182 | 2182 | $return[] = $value; |
2183 | 2183 | } |
@@ -2252,11 +2252,11 @@ discard block |
||
2252 | 2252 | } |
2253 | 2253 | |
2254 | 2254 | $ver = $default; |
2255 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
2255 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
2256 | 2256 | return $ver; |
2257 | 2257 | } |
2258 | 2258 | |
2259 | - $query = $wp_scripts->registered[ $handle ]; |
|
2259 | + $query = $wp_scripts->registered[$handle]; |
|
2260 | 2260 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
2261 | 2261 | $ver = $query->ver; |
2262 | 2262 | } |
@@ -2272,7 +2272,7 @@ discard block |
||
2272 | 2272 | * @return string|null |
2273 | 2273 | */ |
2274 | 2274 | public static function js_redirect( $url, $echo = false ) { |
2275 | - $callback = function () use ( $url ) { |
|
2275 | + $callback = function() use ( $url ) { |
|
2276 | 2276 | echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>'; |
2277 | 2277 | }; |
2278 | 2278 | return self::clip( $callback, $echo ); |
@@ -2367,7 +2367,7 @@ discard block |
||
2367 | 2367 | $suffix = 2; |
2368 | 2368 | do { |
2369 | 2369 | $key_check = $key . $separator . $suffix; |
2370 | - ++$suffix; |
|
2370 | + ++ $suffix; |
|
2371 | 2371 | } while ( in_array( $key_check, $similar_keys, true ) ); |
2372 | 2372 | |
2373 | 2373 | $key = $key_check; |
@@ -2475,7 +2475,7 @@ discard block |
||
2475 | 2475 | |
2476 | 2476 | foreach ( array( 'name', 'description' ) as $var ) { |
2477 | 2477 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
2478 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2478 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2479 | 2479 | unset( $var, $default_val ); |
2480 | 2480 | } |
2481 | 2481 | |
@@ -2531,9 +2531,9 @@ discard block |
||
2531 | 2531 | $meta_value = FrmEntryMeta::get_meta_value( $record, $field->id ); |
2532 | 2532 | }//end if |
2533 | 2533 | |
2534 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
2535 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
2536 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
2534 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
2535 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
2536 | + $new_value = $post_values['item_meta'][$field->id]; |
|
2537 | 2537 | self::unserialize_or_decode( $new_value ); |
2538 | 2538 | } else { |
2539 | 2539 | $new_value = $meta_value; |
@@ -2554,7 +2554,7 @@ discard block |
||
2554 | 2554 | |
2555 | 2555 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
2556 | 2556 | |
2557 | - $values['fields'][ $field->id ] = $field_array; |
|
2557 | + $values['fields'][$field->id] = $field_array; |
|
2558 | 2558 | } |
2559 | 2559 | |
2560 | 2560 | /** |
@@ -2604,11 +2604,11 @@ discard block |
||
2604 | 2604 | } |
2605 | 2605 | |
2606 | 2606 | foreach ( $form->options as $opt => $value ) { |
2607 | - if ( isset( $post_values[ $opt ] ) ) { |
|
2608 | - $values[ $opt ] = $post_values[ $opt ]; |
|
2609 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
2607 | + if ( isset( $post_values[$opt] ) ) { |
|
2608 | + $values[$opt] = $post_values[$opt]; |
|
2609 | + self::unserialize_or_decode( $values[$opt] ); |
|
2610 | 2610 | } else { |
2611 | - $values[ $opt ] = $value; |
|
2611 | + $values[$opt] = $value; |
|
2612 | 2612 | } |
2613 | 2613 | } |
2614 | 2614 | |
@@ -2622,8 +2622,8 @@ discard block |
||
2622 | 2622 | $form_defaults = FrmFormsHelper::get_default_opts(); |
2623 | 2623 | |
2624 | 2624 | foreach ( $form_defaults as $opt => $default ) { |
2625 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
2626 | - $values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default; |
|
2625 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
2626 | + $values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default; |
|
2627 | 2627 | } |
2628 | 2628 | |
2629 | 2629 | unset( $opt, $default ); |
@@ -2634,8 +2634,8 @@ discard block |
||
2634 | 2634 | } |
2635 | 2635 | |
2636 | 2636 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
2637 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
2638 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
2637 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
2638 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
2639 | 2639 | } |
2640 | 2640 | unset( $h ); |
2641 | 2641 | } |
@@ -2830,25 +2830,25 @@ discard block |
||
2830 | 2830 | if ( ! is_numeric( $levels ) ) { |
2831 | 2831 | // Show time in specified unit. |
2832 | 2832 | $levels = self::get_unit( $levels ); |
2833 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
2833 | + if ( isset( $time_strings[$levels] ) ) { |
|
2834 | 2834 | $diff = array( |
2835 | 2835 | $levels => self::time_format( $levels, $diff ), |
2836 | 2836 | ); |
2837 | 2837 | $time_strings = array( |
2838 | - $levels => $time_strings[ $levels ], |
|
2838 | + $levels => $time_strings[$levels], |
|
2839 | 2839 | ); |
2840 | 2840 | } |
2841 | 2841 | $levels = 1; |
2842 | 2842 | } |
2843 | 2843 | |
2844 | 2844 | foreach ( $time_strings as $k => $v ) { |
2845 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
2846 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
2847 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
2845 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
2846 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
2847 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
2848 | 2848 | // Account for 0. |
2849 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
2849 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
2850 | 2850 | } else { |
2851 | - unset( $time_strings[ $k ] ); |
|
2851 | + unset( $time_strings[$k] ); |
|
2852 | 2852 | } |
2853 | 2853 | } |
2854 | 2854 | |
@@ -2867,8 +2867,8 @@ discard block |
||
2867 | 2867 | 'y' => 'y', |
2868 | 2868 | 'd' => 'days', |
2869 | 2869 | ); |
2870 | - if ( isset( $return[ $unit ] ) ) { |
|
2871 | - return $diff[ $return[ $unit ] ]; |
|
2870 | + if ( isset( $return[$unit] ) ) { |
|
2871 | + return $diff[$return[$unit]]; |
|
2872 | 2872 | } |
2873 | 2873 | |
2874 | 2874 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -2876,11 +2876,11 @@ discard block |
||
2876 | 2876 | $times = array( 'h', 'i', 's' ); |
2877 | 2877 | |
2878 | 2878 | foreach ( $times as $time ) { |
2879 | - if ( ! isset( $diff[ $time ] ) ) { |
|
2879 | + if ( ! isset( $diff[$time] ) ) { |
|
2880 | 2880 | continue; |
2881 | 2881 | } |
2882 | 2882 | |
2883 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
2883 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
2884 | 2884 | } |
2885 | 2885 | |
2886 | 2886 | return floor( $total ); |
@@ -2900,7 +2900,7 @@ discard block |
||
2900 | 2900 | 'y' => DAY_IN_SECONDS * 365.25, |
2901 | 2901 | ); |
2902 | 2902 | |
2903 | - return $convert[ $from ] / $convert[ $to ]; |
|
2903 | + return $convert[$from] / $convert[$to]; |
|
2904 | 2904 | } |
2905 | 2905 | |
2906 | 2906 | /** |
@@ -2908,7 +2908,7 @@ discard block |
||
2908 | 2908 | */ |
2909 | 2909 | private static function get_unit( $unit ) { |
2910 | 2910 | $units = self::get_time_strings(); |
2911 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
2911 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
2912 | 2912 | return $unit; |
2913 | 2913 | } |
2914 | 2914 | |
@@ -3024,17 +3024,17 @@ discard block |
||
3024 | 3024 | |
3025 | 3025 | case 1: |
3026 | 3026 | $l2 = $name; |
3027 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
3027 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
3028 | 3028 | break; |
3029 | 3029 | |
3030 | 3030 | case 2: |
3031 | 3031 | $l3 = $name; |
3032 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
3032 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
3033 | 3033 | break; |
3034 | 3034 | |
3035 | 3035 | case 3: |
3036 | 3036 | $l4 = $name; |
3037 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
3037 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
3038 | 3038 | } |
3039 | 3039 | |
3040 | 3040 | unset( $this_val, $n ); |
@@ -3053,8 +3053,8 @@ discard block |
||
3053 | 3053 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
3054 | 3054 | if ( $name == '' ) { |
3055 | 3055 | $vars[] = $val; |
3056 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
3057 | - $vars[ $l1 ] = $val; |
|
3056 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
3057 | + $vars[$l1] = $val; |
|
3058 | 3058 | } |
3059 | 3059 | } |
3060 | 3060 | |
@@ -3071,7 +3071,7 @@ discard block |
||
3071 | 3071 | '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' ), |
3072 | 3072 | ); |
3073 | 3073 | |
3074 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
3074 | + if ( ! isset( $tooltips[$name] ) ) { |
|
3075 | 3075 | return; |
3076 | 3076 | } |
3077 | 3077 | |
@@ -3081,7 +3081,7 @@ discard block |
||
3081 | 3081 | echo ' class="frm_help"'; |
3082 | 3082 | } |
3083 | 3083 | |
3084 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
3084 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
3085 | 3085 | |
3086 | 3086 | if ( 'open' != $class ) { |
3087 | 3087 | echo '"'; |
@@ -3140,13 +3140,13 @@ discard block |
||
3140 | 3140 | } |
3141 | 3141 | |
3142 | 3142 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
3143 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
3143 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
3144 | 3144 | return; |
3145 | 3145 | } |
3146 | 3146 | |
3147 | 3147 | if ( is_array( $val ) ) { |
3148 | 3148 | foreach ( $val as $k1 => $v1 ) { |
3149 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
3149 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
3150 | 3150 | unset( $k1, $v1 ); |
3151 | 3151 | } |
3152 | 3152 | } else { |
@@ -3154,7 +3154,7 @@ discard block |
||
3154 | 3154 | $val = stripslashes( $val ); |
3155 | 3155 | |
3156 | 3156 | // Add backslashes before double quotes and forward slashes only |
3157 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
3157 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
3158 | 3158 | } |
3159 | 3159 | } |
3160 | 3160 | |
@@ -3275,14 +3275,14 @@ discard block |
||
3275 | 3275 | continue; |
3276 | 3276 | } |
3277 | 3277 | $key = $input['name']; |
3278 | - if ( isset( $formatted[ $key ] ) ) { |
|
3279 | - if ( is_array( $formatted[ $key ] ) ) { |
|
3280 | - $formatted[ $key ][] = $input['value']; |
|
3278 | + if ( isset( $formatted[$key] ) ) { |
|
3279 | + if ( is_array( $formatted[$key] ) ) { |
|
3280 | + $formatted[$key][] = $input['value']; |
|
3281 | 3281 | } else { |
3282 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
3282 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
3283 | 3283 | } |
3284 | 3284 | } else { |
3285 | - $formatted[ $key ] = $input['value']; |
|
3285 | + $formatted[$key] = $input['value']; |
|
3286 | 3286 | } |
3287 | 3287 | } |
3288 | 3288 | |
@@ -3990,8 +3990,8 @@ discard block |
||
3990 | 3990 | } |
3991 | 3991 | |
3992 | 3992 | foreach ( $keys as $key ) { |
3993 | - if ( isset( $values[ $key ] ) ) { |
|
3994 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
3993 | + if ( isset( $values[$key] ) ) { |
|
3994 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
3995 | 3995 | } |
3996 | 3996 | } |
3997 | 3997 | |
@@ -4056,7 +4056,7 @@ discard block |
||
4056 | 4056 | 'role', |
4057 | 4057 | 'style', |
4058 | 4058 | ); |
4059 | - $safe = in_array( $key, $safe_keys, true ); |
|
4059 | + $safe = in_array( $key, $safe_keys, true ); |
|
4060 | 4060 | }//end if |
4061 | 4061 | |
4062 | 4062 | /** |
@@ -4195,7 +4195,7 @@ discard block |
||
4195 | 4195 | return 0; |
4196 | 4196 | } |
4197 | 4197 | |
4198 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
4198 | + return strlen( $parts[count( $parts ) - 1] ); |
|
4199 | 4199 | } |
4200 | 4200 | |
4201 | 4201 | /** |
@@ -4215,7 +4215,7 @@ discard block |
||
4215 | 4215 | |
4216 | 4216 | add_filter( |
4217 | 4217 | 'option_gmt_offset', |
4218 | - function ( $offset ) { |
|
4218 | + function( $offset ) { |
|
4219 | 4219 | if ( ! is_string( $offset ) || is_numeric( $offset ) ) { |
4220 | 4220 | // Leave a valid value alone. |
4221 | 4221 | return $offset; |
@@ -4312,7 +4312,7 @@ discard block |
||
4312 | 4312 | return; |
4313 | 4313 | } |
4314 | 4314 | |
4315 | - $ajax_callback = function () use ( $option ) { |
|
4315 | + $ajax_callback = function() use ( $option ) { |
|
4316 | 4316 | self::dismiss_warning_message( $option ); |
4317 | 4317 | }; |
4318 | 4318 | |
@@ -4322,7 +4322,7 @@ discard block |
||
4322 | 4322 | |
4323 | 4323 | add_filter( |
4324 | 4324 | 'frm_message_list', |
4325 | - function ( $show_messages ) use ( $message, $option ) { |
|
4325 | + function( $show_messages ) use ( $message, $option ) { |
|
4326 | 4326 | if ( get_option( $option, false ) ) { |
4327 | 4327 | return $show_messages; |
4328 | 4328 | } |