@@ -230,8 +230,8 @@ discard block |
||
| 230 | 230 | return $this->get_pagenum(); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - if ( isset( $this->_pagination_args[ $key ] ) ) { |
|
| 234 | - return $this->_pagination_args[ $key ]; |
|
| 233 | + if ( isset( $this->_pagination_args[$key] ) ) { |
|
| 234 | + return $this->_pagination_args[$key]; |
|
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 | |
@@ -281,8 +281,8 @@ discard block |
||
| 281 | 281 | * @return void |
| 282 | 282 | */ |
| 283 | 283 | private function hidden_search_inputs( $param_name ) { |
| 284 | - if ( ! empty( $_REQUEST[ $param_name ] ) ) { |
|
| 285 | - $value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) ); |
|
| 284 | + if ( ! empty( $_REQUEST[$param_name] ) ) { |
|
| 285 | + $value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) ); |
|
| 286 | 286 | echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />'; |
| 287 | 287 | } |
| 288 | 288 | } |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | |
| 325 | 325 | echo "<ul class='subsubsub'>\n"; |
| 326 | 326 | foreach ( $views as $class => $view ) { |
| 327 | - $views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
| 327 | + $views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
| 328 | 328 | } |
| 329 | 329 | echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 330 | 330 | echo '</ul>'; |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | |
| 491 | 491 | $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; |
| 492 | 492 | foreach ( $actions as $action => $link ) { |
| 493 | - ++$i; |
|
| 493 | + ++ $i; |
|
| 494 | 494 | $sep = $i === $action_count ? '' : ' | '; |
| 495 | 495 | $out .= "<span class='$action'>$link$sep</span>"; |
| 496 | 496 | } |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | 'next' => __( 'Next page', 'formidable' ), |
| 724 | 724 | ); |
| 725 | 725 | |
| 726 | - return $labels[ $link ]; |
|
| 726 | + return $labels[$link]; |
|
| 727 | 727 | } |
| 728 | 728 | |
| 729 | 729 | private function current_url() { |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | |
| 829 | 829 | // If the primary column doesn't exist fall back to the |
| 830 | 830 | // first non-checkbox column. |
| 831 | - if ( ! isset( $columns[ $default ] ) ) { |
|
| 831 | + if ( ! isset( $columns[$default] ) ) { |
|
| 832 | 832 | $default = self::get_default_primary_column_name(); |
| 833 | 833 | } |
| 834 | 834 | |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | */ |
| 843 | 843 | $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id ); |
| 844 | 844 | |
| 845 | - if ( empty( $column ) || ! isset( $columns[ $column ] ) ) { |
|
| 845 | + if ( empty( $column ) || ! isset( $columns[$column] ) ) { |
|
| 846 | 846 | $column = $default; |
| 847 | 847 | } |
| 848 | 848 | |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | // In 4.3, we added a fourth argument for primary column. |
| 864 | 864 | $column_headers = array( array(), array(), array(), $this->get_primary_column_name() ); |
| 865 | 865 | foreach ( $this->_column_headers as $key => $value ) { |
| 866 | - $column_headers[ $key ] = $value; |
|
| 866 | + $column_headers[$key] = $value; |
|
| 867 | 867 | } |
| 868 | 868 | |
| 869 | 869 | return $column_headers; |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | $data[1] = false; |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | - $sortable[ $id ] = $data; |
|
| 899 | + $sortable[$id] = $data; |
|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | $primary = $this->get_primary_column_name(); |
@@ -954,7 +954,7 @@ discard block |
||
| 954 | 954 | static $cb_counter = 1; |
| 955 | 955 | $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'formidable' ) . '</label>'; |
| 956 | 956 | $columns['cb'] .= '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />'; |
| 957 | - ++$cb_counter; |
|
| 957 | + ++ $cb_counter; |
|
| 958 | 958 | } |
| 959 | 959 | |
| 960 | 960 | foreach ( $columns as $column_key => $column_display_name ) { |
@@ -976,8 +976,8 @@ discard block |
||
| 976 | 976 | $class[] = 'column-primary'; |
| 977 | 977 | } |
| 978 | 978 | |
| 979 | - if ( isset( $sortable[ $column_key ] ) ) { |
|
| 980 | - list( $orderby, $desc_first ) = $sortable[ $column_key ]; |
|
| 979 | + if ( isset( $sortable[$column_key] ) ) { |
|
| 980 | + list( $orderby, $desc_first ) = $sortable[$column_key]; |
|
| 981 | 981 | |
| 982 | 982 | if ( $current_orderby == $orderby ) { |
| 983 | 983 | // The sorted column. The `aria-sort` attribute must be set only on the sorted column. |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | * @return bool Returns true if the setting is not set or if it is not false; otherwise, returns false. |
| 1095 | 1095 | */ |
| 1096 | 1096 | protected function should_display( $args, $settings ) { |
| 1097 | - return ! isset( $args[ $settings ] ) || false !== $args[ $settings ]; |
|
| 1097 | + return ! isset( $args[$settings] ) || false !== $args[$settings]; |
|
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | /** |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | 'fill' => '#4d4d4d', |
| 328 | 328 | 'orange' => '#f05a24', |
| 329 | 329 | ); |
| 330 | - $atts = array_merge( $defaults, $atts ); |
|
| 330 | + $atts = array_merge( $defaults, $atts ); |
|
| 331 | 331 | |
| 332 | 332 | 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'] ) . '"> |
| 333 | 333 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | * @return string |
| 616 | 616 | */ |
| 617 | 617 | public static function get_server_value( $value ) { |
| 618 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
| 618 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | /** |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | $ip = ''; |
| 650 | 650 | |
| 651 | 651 | foreach ( $ip_options as $key ) { |
| 652 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
| 652 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
| 653 | 653 | continue; |
| 654 | 654 | } |
| 655 | 655 | |
@@ -726,10 +726,10 @@ discard block |
||
| 726 | 726 | } |
| 727 | 727 | |
| 728 | 728 | if ( $src === 'get' ) { |
| 729 | - $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 |
|
| 730 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 729 | + $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 |
|
| 730 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 731 | 731 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 732 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
| 732 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
| 733 | 733 | } |
| 734 | 734 | self::sanitize_value( $sanitize, $value ); |
| 735 | 735 | } else { |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | } |
| 751 | 751 | |
| 752 | 752 | $p = trim( $p, ']' ); |
| 753 | - $value = $value[ $p ] ?? $default; |
|
| 753 | + $value = $value[$p] ?? $default; |
|
| 754 | 754 | } |
| 755 | 755 | } |
| 756 | 756 | |
@@ -815,26 +815,26 @@ discard block |
||
| 815 | 815 | 'sanitize' => 'sanitize_text_field', |
| 816 | 816 | 'serialized' => false, |
| 817 | 817 | ); |
| 818 | - $args = wp_parse_args( $args, $defaults ); |
|
| 818 | + $args = wp_parse_args( $args, $defaults ); |
|
| 819 | 819 | |
| 820 | 820 | $value = $args['default']; |
| 821 | 821 | if ( $args['type'] === 'get' ) { |
| 822 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
| 822 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
| 823 | 823 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 824 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
| 824 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
| 825 | 825 | } |
| 826 | 826 | } elseif ( $args['type'] === 'post' ) { |
| 827 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 827 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 828 | 828 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 829 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
| 829 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
| 830 | 830 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
| 831 | 831 | self::unserialize_or_decode( $value ); |
| 832 | 832 | } |
| 833 | 833 | } |
| 834 | - } elseif ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
| 834 | + } elseif ( isset( $_REQUEST[$args['param']] ) ) { |
|
| 835 | 835 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 836 | 836 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 837 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
| 837 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
| 838 | 838 | } |
| 839 | 839 | |
| 840 | 840 | self::sanitize_value( $args['sanitize'], $value ); |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | if ( is_array( $value ) ) { |
| 882 | 882 | $temp_values = $value; |
| 883 | 883 | foreach ( $temp_values as $k => $v ) { |
| 884 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
| 884 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
| 885 | 885 | } |
| 886 | 886 | return; |
| 887 | 887 | } |
@@ -898,8 +898,8 @@ discard block |
||
| 898 | 898 | public static function sanitize_request( $sanitize_method, &$values ) { |
| 899 | 899 | $temp_values = $values; |
| 900 | 900 | foreach ( $temp_values as $k => $val ) { |
| 901 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
| 902 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
| 901 | + if ( isset( $sanitize_method[$k] ) ) { |
|
| 902 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
| 903 | 903 | } |
| 904 | 904 | } |
| 905 | 905 | } |
@@ -961,7 +961,7 @@ discard block |
||
| 961 | 961 | if ( is_array( $value ) ) { |
| 962 | 962 | $temp_values = $value; |
| 963 | 963 | foreach ( $temp_values as $k => $v ) { |
| 964 | - self::decode_specialchars( $value[ $k ] ); |
|
| 964 | + self::decode_specialchars( $value[$k] ); |
|
| 965 | 965 | } |
| 966 | 966 | } else { |
| 967 | 967 | self::decode_amp( $value ); |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | * @return array |
| 1097 | 1097 | */ |
| 1098 | 1098 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
| 1099 | - $allowed_html['input'] = array( |
|
| 1099 | + $allowed_html['input'] = array( |
|
| 1100 | 1100 | 'type' => true, |
| 1101 | 1101 | 'value' => true, |
| 1102 | 1102 | 'formnovalidate' => true, |
@@ -1122,7 +1122,7 @@ discard block |
||
| 1122 | 1122 | $allowed_html = $html; |
| 1123 | 1123 | } elseif ( ! empty( $allowed ) ) { |
| 1124 | 1124 | foreach ( (array) $allowed as $a ) { |
| 1125 | - $allowed_html[ $a ] = $html[ $a ] ?? array(); |
|
| 1125 | + $allowed_html[$a] = $html[$a] ?? array(); |
|
| 1126 | 1126 | } |
| 1127 | 1127 | } |
| 1128 | 1128 | |
@@ -1310,8 +1310,8 @@ discard block |
||
| 1310 | 1310 | } |
| 1311 | 1311 | |
| 1312 | 1312 | global $wp_query; |
| 1313 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
| 1314 | - $value = $wp_query->query_vars[ $param ]; |
|
| 1313 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
| 1314 | + $value = $wp_query->query_vars[$param]; |
|
| 1315 | 1315 | } |
| 1316 | 1316 | |
| 1317 | 1317 | return $value; |
@@ -1342,9 +1342,9 @@ discard block |
||
| 1342 | 1342 | 'frm_keyalt_icon' => 'frm_key_icon', |
| 1343 | 1343 | 'frm_keyalt_solid_icon' => 'frm_key_solid_icon', |
| 1344 | 1344 | ); |
| 1345 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
| 1346 | - $icon = $deprecated[ $icon ]; |
|
| 1347 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
| 1345 | + if ( isset( $deprecated[$icon] ) ) { |
|
| 1346 | + $icon = $deprecated[$icon]; |
|
| 1347 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
| 1348 | 1348 | } |
| 1349 | 1349 | |
| 1350 | 1350 | if ( $icon === $class ) { |
@@ -1467,7 +1467,7 @@ discard block |
||
| 1467 | 1467 | * @return string|void |
| 1468 | 1468 | */ |
| 1469 | 1469 | public static function array_to_html_params( $atts, $echo = false ) { |
| 1470 | - $callback = function () use ( $atts ) { |
|
| 1470 | + $callback = function() use ( $atts ) { |
|
| 1471 | 1471 | if ( $atts ) { |
| 1472 | 1472 | foreach ( $atts as $key => $value ) { |
| 1473 | 1473 | echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
@@ -1648,7 +1648,7 @@ discard block |
||
| 1648 | 1648 | 'value' => false, |
| 1649 | 1649 | 'class' => '', |
| 1650 | 1650 | ); |
| 1651 | - $atts = array_merge( $defaults, $atts ); |
|
| 1651 | + $atts = array_merge( $defaults, $atts ); |
|
| 1652 | 1652 | |
| 1653 | 1653 | if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) { |
| 1654 | 1654 | $atts['tosearch'] = 'frm-card'; |
@@ -1725,7 +1725,7 @@ discard block |
||
| 1725 | 1725 | 'new_file_path' => self::plugin_path() . '/js', |
| 1726 | 1726 | ) |
| 1727 | 1727 | ); |
| 1728 | - $new_file = new FrmCreateFile( $file_atts ); |
|
| 1728 | + $new_file = new FrmCreateFile( $file_atts ); |
|
| 1729 | 1729 | |
| 1730 | 1730 | $files = array( |
| 1731 | 1731 | self::plugin_path() . '/js/formidable.min.js', |
@@ -1939,8 +1939,8 @@ discard block |
||
| 1939 | 1939 | */ |
| 1940 | 1940 | private static function get_dropdown_value_and_label_from_option( $option, $key, $args ) { |
| 1941 | 1941 | if ( is_array( $option ) ) { |
| 1942 | - $value = $option[ $args['value_key'] ] ?? ''; |
|
| 1943 | - $label = $option[ $args['label_key'] ] ?? ''; |
|
| 1942 | + $value = $option[$args['value_key']] ?? ''; |
|
| 1943 | + $label = $option[$args['label_key']] ?? ''; |
|
| 1944 | 1944 | } else { |
| 1945 | 1945 | $value = $key; |
| 1946 | 1946 | $label = $option; |
@@ -2334,8 +2334,8 @@ discard block |
||
| 2334 | 2334 | return $error; |
| 2335 | 2335 | } |
| 2336 | 2336 | |
| 2337 | - $nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
| 2338 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
| 2337 | + $nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
| 2338 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
| 2339 | 2339 | $frm_settings = self::get_settings(); |
| 2340 | 2340 | $error = $frm_settings->admin_permission; |
| 2341 | 2341 | } |
@@ -2389,7 +2389,7 @@ discard block |
||
| 2389 | 2389 | } else { |
| 2390 | 2390 | foreach ( $value as $k => $v ) { |
| 2391 | 2391 | if ( ! is_array( $v ) ) { |
| 2392 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
| 2392 | + $value[$k] = call_user_func( $original_function, $v ); |
|
| 2393 | 2393 | } |
| 2394 | 2394 | } |
| 2395 | 2395 | } |
@@ -2440,7 +2440,7 @@ discard block |
||
| 2440 | 2440 | if ( is_array( $value ) ) { |
| 2441 | 2441 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
| 2442 | 2442 | } elseif ( $keys === 'keep' ) { |
| 2443 | - $return[ $key ] = $value; |
|
| 2443 | + $return[$key] = $value; |
|
| 2444 | 2444 | } else { |
| 2445 | 2445 | $return[] = $value; |
| 2446 | 2446 | } |
@@ -2527,11 +2527,11 @@ discard block |
||
| 2527 | 2527 | } |
| 2528 | 2528 | |
| 2529 | 2529 | $ver = $default; |
| 2530 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
| 2530 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
| 2531 | 2531 | return $ver; |
| 2532 | 2532 | } |
| 2533 | 2533 | |
| 2534 | - $query = $wp_scripts->registered[ $handle ]; |
|
| 2534 | + $query = $wp_scripts->registered[$handle]; |
|
| 2535 | 2535 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
| 2536 | 2536 | $ver = $query->ver; |
| 2537 | 2537 | } |
@@ -2547,7 +2547,7 @@ discard block |
||
| 2547 | 2547 | * @return string|null |
| 2548 | 2548 | */ |
| 2549 | 2549 | public static function js_redirect( $url, $echo = false ) { |
| 2550 | - $callback = function () use ( $url ) { |
|
| 2550 | + $callback = function() use ( $url ) { |
|
| 2551 | 2551 | echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>'; |
| 2552 | 2552 | }; |
| 2553 | 2553 | return self::clip( $callback, $echo ); |
@@ -2647,7 +2647,7 @@ discard block |
||
| 2647 | 2647 | $suffix = 2; |
| 2648 | 2648 | do { |
| 2649 | 2649 | $key_check = $key . $separator . $suffix; |
| 2650 | - ++$suffix; |
|
| 2650 | + ++ $suffix; |
|
| 2651 | 2651 | } while ( in_array( $key_check, $similar_keys, true ) ); |
| 2652 | 2652 | |
| 2653 | 2653 | $key = $key_check; |
@@ -2757,7 +2757,7 @@ discard block |
||
| 2757 | 2757 | |
| 2758 | 2758 | foreach ( array( 'name', 'description' ) as $var ) { |
| 2759 | 2759 | $default_val = $record->{$var} ?? ''; |
| 2760 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
| 2760 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
| 2761 | 2761 | unset( $var, $default_val ); |
| 2762 | 2762 | } |
| 2763 | 2763 | |
@@ -2829,9 +2829,9 @@ discard block |
||
| 2829 | 2829 | $meta_value = FrmEntryMeta::get_meta_value( $record, $field->id ); |
| 2830 | 2830 | }//end if |
| 2831 | 2831 | |
| 2832 | - $field_type = $post_values['field_options'][ 'type_' . $field->id ] ?? $field->type; |
|
| 2833 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
| 2834 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
| 2832 | + $field_type = $post_values['field_options']['type_' . $field->id] ?? $field->type; |
|
| 2833 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
| 2834 | + $new_value = $post_values['item_meta'][$field->id]; |
|
| 2835 | 2835 | self::unserialize_or_decode( $new_value ); |
| 2836 | 2836 | } else { |
| 2837 | 2837 | $new_value = $meta_value; |
@@ -2852,7 +2852,7 @@ discard block |
||
| 2852 | 2852 | |
| 2853 | 2853 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
| 2854 | 2854 | |
| 2855 | - $values['fields'][ $field->id ] = $field_array; |
|
| 2855 | + $values['fields'][$field->id] = $field_array; |
|
| 2856 | 2856 | } |
| 2857 | 2857 | |
| 2858 | 2858 | /** |
@@ -2902,11 +2902,11 @@ discard block |
||
| 2902 | 2902 | } |
| 2903 | 2903 | |
| 2904 | 2904 | foreach ( $form->options as $opt => $value ) { |
| 2905 | - if ( isset( $post_values[ $opt ] ) ) { |
|
| 2906 | - $values[ $opt ] = $post_values[ $opt ]; |
|
| 2907 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
| 2905 | + if ( isset( $post_values[$opt] ) ) { |
|
| 2906 | + $values[$opt] = $post_values[$opt]; |
|
| 2907 | + self::unserialize_or_decode( $values[$opt] ); |
|
| 2908 | 2908 | } else { |
| 2909 | - $values[ $opt ] = $value; |
|
| 2909 | + $values[$opt] = $value; |
|
| 2910 | 2910 | } |
| 2911 | 2911 | } |
| 2912 | 2912 | |
@@ -2925,8 +2925,8 @@ discard block |
||
| 2925 | 2925 | $form_defaults = FrmFormsHelper::get_default_opts(); |
| 2926 | 2926 | |
| 2927 | 2927 | foreach ( $form_defaults as $opt => $default ) { |
| 2928 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
| 2929 | - $values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default; |
|
| 2928 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
| 2929 | + $values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default; |
|
| 2930 | 2930 | } |
| 2931 | 2931 | |
| 2932 | 2932 | unset( $opt, $default ); |
@@ -2937,8 +2937,8 @@ discard block |
||
| 2937 | 2937 | } |
| 2938 | 2938 | |
| 2939 | 2939 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
| 2940 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
| 2941 | - $values[ $h . '_html' ] = ( $post_values['options'][ $h . '_html' ] ?? FrmFormsHelper::get_default_html( $h ) ); |
|
| 2940 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
| 2941 | + $values[$h . '_html'] = ( $post_values['options'][$h . '_html'] ?? FrmFormsHelper::get_default_html( $h ) ); |
|
| 2942 | 2942 | } |
| 2943 | 2943 | unset( $h ); |
| 2944 | 2944 | } |
@@ -3152,25 +3152,25 @@ discard block |
||
| 3152 | 3152 | if ( ! is_numeric( $levels ) ) { |
| 3153 | 3153 | // Show time in specified unit. |
| 3154 | 3154 | $levels = self::get_unit( $levels ); |
| 3155 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
| 3155 | + if ( isset( $time_strings[$levels] ) ) { |
|
| 3156 | 3156 | $diff = array( |
| 3157 | 3157 | $levels => self::time_format( $levels, $diff ), |
| 3158 | 3158 | ); |
| 3159 | 3159 | $time_strings = array( |
| 3160 | - $levels => $time_strings[ $levels ], |
|
| 3160 | + $levels => $time_strings[$levels], |
|
| 3161 | 3161 | ); |
| 3162 | 3162 | } |
| 3163 | 3163 | $levels = 1; |
| 3164 | 3164 | } |
| 3165 | 3165 | |
| 3166 | 3166 | foreach ( $time_strings as $k => $v ) { |
| 3167 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
| 3168 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
| 3169 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
| 3167 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
| 3168 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
| 3169 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
| 3170 | 3170 | // Account for 0. |
| 3171 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
| 3171 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
| 3172 | 3172 | } else { |
| 3173 | - unset( $time_strings[ $k ] ); |
|
| 3173 | + unset( $time_strings[$k] ); |
|
| 3174 | 3174 | } |
| 3175 | 3175 | } |
| 3176 | 3176 | |
@@ -3194,8 +3194,8 @@ discard block |
||
| 3194 | 3194 | 'y' => 'y', |
| 3195 | 3195 | 'd' => 'days', |
| 3196 | 3196 | ); |
| 3197 | - if ( isset( $return[ $unit ] ) ) { |
|
| 3198 | - return $diff[ $return[ $unit ] ]; |
|
| 3197 | + if ( isset( $return[$unit] ) ) { |
|
| 3198 | + return $diff[$return[$unit]]; |
|
| 3199 | 3199 | } |
| 3200 | 3200 | |
| 3201 | 3201 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -3203,11 +3203,11 @@ discard block |
||
| 3203 | 3203 | $times = array( 'h', 'i', 's' ); |
| 3204 | 3204 | |
| 3205 | 3205 | foreach ( $times as $time ) { |
| 3206 | - if ( ! isset( $diff[ $time ] ) ) { |
|
| 3206 | + if ( ! isset( $diff[$time] ) ) { |
|
| 3207 | 3207 | continue; |
| 3208 | 3208 | } |
| 3209 | 3209 | |
| 3210 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
| 3210 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
| 3211 | 3211 | } |
| 3212 | 3212 | |
| 3213 | 3213 | return floor( $total ); |
@@ -3232,7 +3232,7 @@ discard block |
||
| 3232 | 3232 | 'y' => DAY_IN_SECONDS * 365.25, |
| 3233 | 3233 | ); |
| 3234 | 3234 | |
| 3235 | - return $convert[ $from ] / $convert[ $to ]; |
|
| 3235 | + return $convert[$from] / $convert[$to]; |
|
| 3236 | 3236 | } |
| 3237 | 3237 | |
| 3238 | 3238 | /** |
@@ -3244,7 +3244,7 @@ discard block |
||
| 3244 | 3244 | */ |
| 3245 | 3245 | private static function get_unit( $unit ) { |
| 3246 | 3246 | $units = self::get_time_strings(); |
| 3247 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
| 3247 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
| 3248 | 3248 | return $unit; |
| 3249 | 3249 | } |
| 3250 | 3250 | |
@@ -3362,17 +3362,17 @@ discard block |
||
| 3362 | 3362 | |
| 3363 | 3363 | case 1: |
| 3364 | 3364 | $l2 = $name; |
| 3365 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
| 3365 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
| 3366 | 3366 | break; |
| 3367 | 3367 | |
| 3368 | 3368 | case 2: |
| 3369 | 3369 | $l3 = $name; |
| 3370 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
| 3370 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
| 3371 | 3371 | break; |
| 3372 | 3372 | |
| 3373 | 3373 | case 3: |
| 3374 | 3374 | $l4 = $name; |
| 3375 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
| 3375 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
| 3376 | 3376 | } |
| 3377 | 3377 | |
| 3378 | 3378 | unset( $this_val, $n ); |
@@ -3395,8 +3395,8 @@ discard block |
||
| 3395 | 3395 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
| 3396 | 3396 | if ( $name == '' ) { |
| 3397 | 3397 | $vars[] = $val; |
| 3398 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
| 3399 | - $vars[ $l1 ] = $val; |
|
| 3398 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
| 3399 | + $vars[$l1] = $val; |
|
| 3400 | 3400 | } |
| 3401 | 3401 | } |
| 3402 | 3402 | |
@@ -3420,7 +3420,7 @@ discard block |
||
| 3420 | 3420 | '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' ), |
| 3421 | 3421 | ); |
| 3422 | 3422 | |
| 3423 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
| 3423 | + if ( ! isset( $tooltips[$name] ) ) { |
|
| 3424 | 3424 | return; |
| 3425 | 3425 | } |
| 3426 | 3426 | |
@@ -3430,7 +3430,7 @@ discard block |
||
| 3430 | 3430 | echo ' class="frm_help"'; |
| 3431 | 3431 | } |
| 3432 | 3432 | |
| 3433 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
| 3433 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
| 3434 | 3434 | |
| 3435 | 3435 | if ( 'open' != $class ) { |
| 3436 | 3436 | echo '"'; |
@@ -3502,13 +3502,13 @@ discard block |
||
| 3502 | 3502 | * @return void |
| 3503 | 3503 | */ |
| 3504 | 3504 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
| 3505 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
| 3505 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
| 3506 | 3506 | return; |
| 3507 | 3507 | } |
| 3508 | 3508 | |
| 3509 | 3509 | if ( is_array( $val ) ) { |
| 3510 | 3510 | foreach ( $val as $k1 => $v1 ) { |
| 3511 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
| 3511 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
| 3512 | 3512 | unset( $k1, $v1 ); |
| 3513 | 3513 | } |
| 3514 | 3514 | } else { |
@@ -3516,7 +3516,7 @@ discard block |
||
| 3516 | 3516 | $val = stripslashes( $val ); |
| 3517 | 3517 | |
| 3518 | 3518 | // Add backslashes before double quotes and forward slashes only |
| 3519 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
| 3519 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
| 3520 | 3520 | } |
| 3521 | 3521 | } |
| 3522 | 3522 | |
@@ -3640,14 +3640,14 @@ discard block |
||
| 3640 | 3640 | continue; |
| 3641 | 3641 | } |
| 3642 | 3642 | $key = $input['name']; |
| 3643 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 3644 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 3645 | - $formatted[ $key ][] = $input['value']; |
|
| 3643 | + if ( isset( $formatted[$key] ) ) { |
|
| 3644 | + if ( is_array( $formatted[$key] ) ) { |
|
| 3645 | + $formatted[$key][] = $input['value']; |
|
| 3646 | 3646 | } else { |
| 3647 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 3647 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 3648 | 3648 | } |
| 3649 | 3649 | } else { |
| 3650 | - $formatted[ $key ] = $input['value']; |
|
| 3650 | + $formatted[$key] = $input['value']; |
|
| 3651 | 3651 | } |
| 3652 | 3652 | } |
| 3653 | 3653 | |
@@ -4354,8 +4354,8 @@ discard block |
||
| 4354 | 4354 | } |
| 4355 | 4355 | |
| 4356 | 4356 | foreach ( $keys as $key ) { |
| 4357 | - if ( isset( $values[ $key ] ) ) { |
|
| 4358 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
| 4357 | + if ( isset( $values[$key] ) ) { |
|
| 4358 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
| 4359 | 4359 | } |
| 4360 | 4360 | } |
| 4361 | 4361 | |
@@ -4420,7 +4420,7 @@ discard block |
||
| 4420 | 4420 | 'role', |
| 4421 | 4421 | 'style', |
| 4422 | 4422 | ); |
| 4423 | - $safe = in_array( $key, $safe_keys, true ); |
|
| 4423 | + $safe = in_array( $key, $safe_keys, true ); |
|
| 4424 | 4424 | }//end if |
| 4425 | 4425 | |
| 4426 | 4426 | /** |
@@ -4559,7 +4559,7 @@ discard block |
||
| 4559 | 4559 | return 0; |
| 4560 | 4560 | } |
| 4561 | 4561 | |
| 4562 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
| 4562 | + return strlen( $parts[count( $parts ) - 1] ); |
|
| 4563 | 4563 | } |
| 4564 | 4564 | |
| 4565 | 4565 | /** |
@@ -4579,7 +4579,7 @@ discard block |
||
| 4579 | 4579 | |
| 4580 | 4580 | add_filter( |
| 4581 | 4581 | 'option_gmt_offset', |
| 4582 | - function ( $offset ) { |
|
| 4582 | + function( $offset ) { |
|
| 4583 | 4583 | if ( ! is_string( $offset ) || is_numeric( $offset ) ) { |
| 4584 | 4584 | // Leave a valid value alone. |
| 4585 | 4585 | return $offset; |
@@ -4676,7 +4676,7 @@ discard block |
||
| 4676 | 4676 | return; |
| 4677 | 4677 | } |
| 4678 | 4678 | |
| 4679 | - $ajax_callback = function () use ( $option ) { |
|
| 4679 | + $ajax_callback = function() use ( $option ) { |
|
| 4680 | 4680 | self::dismiss_warning_message( $option ); |
| 4681 | 4681 | }; |
| 4682 | 4682 | |
@@ -4686,7 +4686,7 @@ discard block |
||
| 4686 | 4686 | |
| 4687 | 4687 | add_filter( |
| 4688 | 4688 | 'frm_message_list', |
| 4689 | - function ( $show_messages ) use ( $message, $option ) { |
|
| 4689 | + function( $show_messages ) use ( $message, $option ) { |
|
| 4690 | 4690 | if ( get_option( $option, false ) ) { |
| 4691 | 4691 | return $show_messages; |
| 4692 | 4692 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | if ( in_array( $type, array( 'data', 'lookup' ), true ) ) { |
| 45 | 45 | $values['field_options']['data_type'] = $setting; |
| 46 | 46 | } else { |
| 47 | - $values['field_options'][ $setting ] = 1; |
|
| 47 | + $values['field_options'][$setting] = 1; |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
@@ -206,10 +206,10 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | foreach ( $defaults as $opt => $default ) { |
| 209 | - $values[ $opt ] = $field->field_options[ $opt ] ?? $default; |
|
| 209 | + $values[$opt] = $field->field_options[$opt] ?? $default; |
|
| 210 | 210 | |
| 211 | 211 | if ( $check_post ) { |
| 212 | - self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] ); |
|
| 212 | + self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] ); |
|
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | return self::$context_is_safe_to_load_field_options_from_request_data; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - $function = function () { |
|
| 229 | + $function = function() { |
|
| 230 | 230 | if ( ! FrmAppHelper::is_admin_page() ) { |
| 231 | 231 | return false; |
| 232 | 232 | } |
@@ -338,12 +338,12 @@ discard block |
||
| 338 | 338 | * @return void |
| 339 | 339 | */ |
| 340 | 340 | private static function get_posted_field_setting( $setting, &$value ) { |
| 341 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 341 | + if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 342 | 342 | return; |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | if ( strpos( $setting, 'html' ) !== false ) { |
| 346 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 346 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 347 | 347 | |
| 348 | 348 | // Conditionally strip script tags if the user sending $_POST data is not allowed to use unfiltered HTML. |
| 349 | 349 | if ( ! FrmAppHelper::allow_unfiltered_html() ) { |
@@ -351,9 +351,9 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | } elseif ( strpos( $setting, 'format_' ) === 0 ) { |
| 353 | 353 | // TODO: Remove stripslashes on output, and use on input only. |
| 354 | - $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 354 | + $value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 355 | 355 | } else { |
| 356 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 356 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 357 | 357 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 358 | 358 | } |
| 359 | 359 | } |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | $values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value ); |
| 437 | 437 | |
| 438 | 438 | foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) { |
| 439 | - $values[ $col ] = $field->{$col}; |
|
| 439 | + $values[$col] = $field->{$col}; |
|
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | 442 | |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | ); |
| 475 | 475 | |
| 476 | 476 | $msg = FrmField::get_option( $field, $error ); |
| 477 | - $msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg; |
|
| 477 | + $msg = empty( $msg ) ? $defaults[$error]['part'] : $msg; |
|
| 478 | 478 | $msg = do_shortcode( $msg ); |
| 479 | 479 | |
| 480 | 480 | $msg = self::maybe_replace_substrings_with_field_name( $msg, $error, $field ); |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | 'inside_class' => 'inside', |
| 799 | 799 | 'dismiss-icon' => true, |
| 800 | 800 | ); |
| 801 | - $args = array_merge( $defaults, $args ); |
|
| 801 | + $args = array_merge( $defaults, $args ); |
|
| 802 | 802 | |
| 803 | 803 | include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php'; |
| 804 | 804 | } |
@@ -1082,7 +1082,7 @@ discard block |
||
| 1082 | 1082 | continue; |
| 1083 | 1083 | } |
| 1084 | 1084 | |
| 1085 | - $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] ); |
|
| 1085 | + $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] ); |
|
| 1086 | 1086 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 1087 | 1087 | |
| 1088 | 1088 | $atts['entry'] = $entry; |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | if ( $replace_with !== null ) { |
| 1093 | 1093 | $replace_with = self::trigger_shortcode_atts( $replace_with, $atts ); |
| 1094 | 1094 | self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with ); |
| 1095 | - $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content ); |
|
| 1095 | + $content = str_replace( $shortcodes[0][$short_key], $replace_with, $content ); |
|
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | 1098 | unset( $atts, $replace_with ); |
@@ -1110,7 +1110,7 @@ discard block |
||
| 1110 | 1110 | $supported_atts = array( 'remove_accents', 'sanitize', 'sanitize_url' ); |
| 1111 | 1111 | $included_atts = array_intersect( $supported_atts, array_keys( $atts ) ); |
| 1112 | 1112 | foreach ( $included_atts as $included_att ) { |
| 1113 | - if ( '0' === $atts[ $included_att ] ) { |
|
| 1113 | + if ( '0' === $atts[$included_att] ) { |
|
| 1114 | 1114 | // Skip any option that uses 0 so sanitize_url=0 does not encode. |
| 1115 | 1115 | continue; |
| 1116 | 1116 | } |
@@ -1188,8 +1188,8 @@ discard block |
||
| 1188 | 1188 | |
| 1189 | 1189 | $dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get', 'default-email', 'default-from-email' ); |
| 1190 | 1190 | |
| 1191 | - if ( isset( $shortcode_values[ $atts['tag'] ] ) ) { |
|
| 1192 | - $replace_with = $shortcode_values[ $atts['tag'] ]; |
|
| 1191 | + if ( isset( $shortcode_values[$atts['tag']] ) ) { |
|
| 1192 | + $replace_with = $shortcode_values[$atts['tag']]; |
|
| 1193 | 1193 | } elseif ( in_array( $atts['tag'], $dynamic_default, true ) ) { |
| 1194 | 1194 | $replace_with = self::dynamic_default_values( $atts['tag'], $atts ); |
| 1195 | 1195 | } elseif ( $clean_tag === 'user_agent' ) { |
@@ -1435,8 +1435,8 @@ discard block |
||
| 1435 | 1435 | self::field_types_for_input( $single_input, $field_selection, $field_types ); |
| 1436 | 1436 | } elseif ( in_array( $type, $multiple_input, true ) ) { |
| 1437 | 1437 | self::field_types_for_input( $multiple_input, $field_selection, $field_types ); |
| 1438 | - } elseif ( isset( $field_selection[ $type ] ) ) { |
|
| 1439 | - $field_types[ $type ] = $field_selection[ $type ]; |
|
| 1438 | + } elseif ( isset( $field_selection[$type] ) ) { |
|
| 1439 | + $field_types[$type] = $field_selection[$type]; |
|
| 1440 | 1440 | } |
| 1441 | 1441 | |
| 1442 | 1442 | $field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) ); |
@@ -1480,7 +1480,7 @@ discard block |
||
| 1480 | 1480 | foreach ( $inputs as $input ) { |
| 1481 | 1481 | // This may not be set if a field type was removed using the frm_available_fields or frm_pro_available_fields filters. |
| 1482 | 1482 | if ( array_key_exists( $input, $fields ) ) { |
| 1483 | - $field_types[ $input ] = $fields[ $input ]; |
|
| 1483 | + $field_types[$input] = $fields[$input]; |
|
| 1484 | 1484 | } |
| 1485 | 1485 | unset( $input ); |
| 1486 | 1486 | } |
@@ -1515,7 +1515,7 @@ discard block |
||
| 1515 | 1515 | 'parent' => false, |
| 1516 | 1516 | 'pointer' => false, |
| 1517 | 1517 | ); |
| 1518 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1518 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1519 | 1519 | |
| 1520 | 1520 | $opt_key = $args['opt_key']; |
| 1521 | 1521 | $field = $args['field']; |
@@ -1531,25 +1531,25 @@ discard block |
||
| 1531 | 1531 | |
| 1532 | 1532 | // Check posted vals before checking saved values |
| 1533 | 1533 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1534 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1534 | + if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1535 | 1535 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1536 | 1536 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1537 | - $other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1537 | + $other_val = isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1538 | 1538 | } else { |
| 1539 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1539 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1540 | 1540 | } |
| 1541 | 1541 | |
| 1542 | 1542 | return $other_val; |
| 1543 | 1543 | } |
| 1544 | 1544 | |
| 1545 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1545 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1546 | 1546 | // For normal fields |
| 1547 | 1547 | |
| 1548 | 1548 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1549 | 1549 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1550 | - $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1550 | + $other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1551 | 1551 | } else { |
| 1552 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1552 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1553 | 1553 | } |
| 1554 | 1554 | |
| 1555 | 1555 | return $other_val; |
@@ -1559,8 +1559,8 @@ discard block |
||
| 1559 | 1559 | if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) { |
| 1560 | 1560 | // Check if there is an "other" val in saved value and make sure the |
| 1561 | 1561 | // "other" val is not equal to the Other checkbox option |
| 1562 | - if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) { |
|
| 1563 | - $other_val = $field['value'][ $opt_key ]; |
|
| 1562 | + if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) { |
|
| 1563 | + $other_val = $field['value'][$opt_key]; |
|
| 1564 | 1564 | } |
| 1565 | 1565 | } else { |
| 1566 | 1566 | /** |
@@ -1572,8 +1572,8 @@ discard block |
||
| 1572 | 1572 | // Multi-select dropdowns - key is not preserved |
| 1573 | 1573 | if ( is_array( $field['value'] ) ) { |
| 1574 | 1574 | $o_key = array_search( $temp_val, $field['value'] ); |
| 1575 | - if ( isset( $field['value'][ $o_key ] ) ) { |
|
| 1576 | - unset( $field['value'][ $o_key ], $o_key ); |
|
| 1575 | + if ( isset( $field['value'][$o_key] ) ) { |
|
| 1576 | + unset( $field['value'][$o_key], $o_key ); |
|
| 1577 | 1577 | } |
| 1578 | 1578 | } elseif ( $temp_val == $field['value'] ) { |
| 1579 | 1579 | // For radio and regular dropdowns |
@@ -1798,11 +1798,11 @@ discard block |
||
| 1798 | 1798 | foreach ( $val as $k => $v ) { |
| 1799 | 1799 | if ( is_string( $v ) ) { |
| 1800 | 1800 | if ( 'custom_html' === $k ) { |
| 1801 | - $val[ $k ] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
| 1801 | + $val[$k] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
| 1802 | 1802 | unset( $k, $v ); |
| 1803 | 1803 | continue; |
| 1804 | 1804 | } |
| 1805 | - $val[ $k ] = str_replace( $replace, $replace_with, $v ); |
|
| 1805 | + $val[$k] = str_replace( $replace, $replace_with, $v ); |
|
| 1806 | 1806 | unset( $k, $v ); |
| 1807 | 1807 | } |
| 1808 | 1808 | } |
@@ -1831,8 +1831,8 @@ discard block |
||
| 1831 | 1831 | if ( false === $index ) { |
| 1832 | 1832 | continue; |
| 1833 | 1833 | } |
| 1834 | - unset( $replace[ $index ] ); |
|
| 1835 | - unset( $replace_with[ $index ] ); |
|
| 1834 | + unset( $replace[$index] ); |
|
| 1835 | + unset( $replace_with[$index] ); |
|
| 1836 | 1836 | } |
| 1837 | 1837 | $value = str_replace( $replace, $replace_with, $value ); |
| 1838 | 1838 | return $value; |
@@ -2190,7 +2190,7 @@ discard block |
||
| 2190 | 2190 | $countries['class'] = 'frm-countries-opts'; |
| 2191 | 2191 | } |
| 2192 | 2192 | |
| 2193 | - $prepop[ __( 'Countries', 'formidable' ) ] = $countries; |
|
| 2193 | + $prepop[__( 'Countries', 'formidable' )] = $countries; |
|
| 2194 | 2194 | |
| 2195 | 2195 | // State abv. |
| 2196 | 2196 | $states = self::get_us_states(); |
@@ -2200,7 +2200,7 @@ discard block |
||
| 2200 | 2200 | $state_abv['class'] = 'frm-state-abv-opts'; |
| 2201 | 2201 | } |
| 2202 | 2202 | |
| 2203 | - $prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv; |
|
| 2203 | + $prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv; |
|
| 2204 | 2204 | |
| 2205 | 2205 | // States. |
| 2206 | 2206 | $states = array_values( $states ); |
@@ -2209,7 +2209,7 @@ discard block |
||
| 2209 | 2209 | $states['class'] = 'frm-states-opts'; |
| 2210 | 2210 | } |
| 2211 | 2211 | |
| 2212 | - $prepop[ __( 'U.S. States', 'formidable' ) ] = $states; |
|
| 2212 | + $prepop[__( 'U.S. States', 'formidable' )] = $states; |
|
| 2213 | 2213 | unset( $state_abv, $states ); |
| 2214 | 2214 | |
| 2215 | 2215 | // Age. |
@@ -2227,7 +2227,7 @@ discard block |
||
| 2227 | 2227 | $ages['class'] = 'frm-age-opts'; |
| 2228 | 2228 | } |
| 2229 | 2229 | |
| 2230 | - $prepop[ __( 'Age', 'formidable' ) ] = $ages; |
|
| 2230 | + $prepop[__( 'Age', 'formidable' )] = $ages; |
|
| 2231 | 2231 | |
| 2232 | 2232 | // Satisfaction. |
| 2233 | 2233 | $satisfaction = array( |
@@ -2242,7 +2242,7 @@ discard block |
||
| 2242 | 2242 | $satisfaction['class'] = 'frm-satisfaction-opts'; |
| 2243 | 2243 | } |
| 2244 | 2244 | |
| 2245 | - $prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction; |
|
| 2245 | + $prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction; |
|
| 2246 | 2246 | |
| 2247 | 2247 | // Importance. |
| 2248 | 2248 | $importance = array( |
@@ -2257,7 +2257,7 @@ discard block |
||
| 2257 | 2257 | $importance['class'] = 'frm-importance-opts'; |
| 2258 | 2258 | } |
| 2259 | 2259 | |
| 2260 | - $prepop[ __( 'Importance', 'formidable' ) ] = $importance; |
|
| 2260 | + $prepop[__( 'Importance', 'formidable' )] = $importance; |
|
| 2261 | 2261 | |
| 2262 | 2262 | // Agreement. |
| 2263 | 2263 | $agreement = array( |
@@ -2272,7 +2272,7 @@ discard block |
||
| 2272 | 2272 | $agreement['class'] = 'frm-agreement-opts'; |
| 2273 | 2273 | } |
| 2274 | 2274 | |
| 2275 | - $prepop[ __( 'Agreement', 'formidable' ) ] = $agreement; |
|
| 2275 | + $prepop[__( 'Agreement', 'formidable' )] = $agreement; |
|
| 2276 | 2276 | |
| 2277 | 2277 | // Likely. |
| 2278 | 2278 | $likely = array( |
@@ -2287,7 +2287,7 @@ discard block |
||
| 2287 | 2287 | $likely['class'] = 'frm-likely-opts'; |
| 2288 | 2288 | } |
| 2289 | 2289 | |
| 2290 | - $prepop[ __( 'Likely', 'formidable' ) ] = $likely; |
|
| 2290 | + $prepop[__( 'Likely', 'formidable' )] = $likely; |
|
| 2291 | 2291 | |
| 2292 | 2292 | $prepop = apply_filters( 'frm_bulk_field_choices', $prepop ); |
| 2293 | 2293 | } |
@@ -2516,16 +2516,16 @@ discard block |
||
| 2516 | 2516 | */ |
| 2517 | 2517 | private static function fill_image_setting_options( $options, &$args ) { |
| 2518 | 2518 | foreach ( $options as $key => $option ) { |
| 2519 | - $args['options'][ $key ] = $option; |
|
| 2519 | + $args['options'][$key] = $option; |
|
| 2520 | 2520 | |
| 2521 | 2521 | if ( ! empty( $option['addon'] ) ) { |
| 2522 | - $args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2522 | + $args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2523 | 2523 | } |
| 2524 | 2524 | |
| 2525 | - unset( $args['options'][ $key ]['addon'] ); |
|
| 2525 | + unset( $args['options'][$key]['addon'] ); |
|
| 2526 | 2526 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2527 | 2527 | foreach ( $fill as $f ) { |
| 2528 | - unset( $args['options'][ $key ][ $f ], $f ); |
|
| 2528 | + unset( $args['options'][$key][$f], $f ); |
|
| 2529 | 2529 | } |
| 2530 | 2530 | } |
| 2531 | 2531 | } |
@@ -2548,8 +2548,8 @@ discard block |
||
| 2548 | 2548 | |
| 2549 | 2549 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2550 | 2550 | foreach ( $fill as $f ) { |
| 2551 | - if ( isset( $option[ $f ] ) ) { |
|
| 2552 | - $custom_attrs[ 'data-' . $f ] = $option[ $f ]; |
|
| 2551 | + if ( isset( $option[$f] ) ) { |
|
| 2552 | + $custom_attrs['data-' . $f] = $option[$f]; |
|
| 2553 | 2553 | } |
| 2554 | 2554 | } |
| 2555 | 2555 | |
@@ -2615,7 +2615,7 @@ discard block |
||
| 2615 | 2615 | |
| 2616 | 2616 | return array_filter( |
| 2617 | 2617 | $rows, |
| 2618 | - function ( $row ) { |
|
| 2618 | + function( $row ) { |
|
| 2619 | 2619 | FrmAppHelper::unserialize_or_decode( $row->field_options ); |
| 2620 | 2620 | return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] ); |
| 2621 | 2621 | } |
@@ -2680,7 +2680,7 @@ discard block |
||
| 2680 | 2680 | if ( empty( $attributes['data-fid'] ) ) { |
| 2681 | 2681 | unset( $data['plugin-status'] ); |
| 2682 | 2682 | foreach ( $data as $key => $value ) { |
| 2683 | - $attributes[ 'data-' . $key ] = $value; |
|
| 2683 | + $attributes['data-' . $key] = $value; |
|
| 2684 | 2684 | } |
| 2685 | 2685 | } |
| 2686 | 2686 | |
@@ -231,7 +231,8 @@ discard block |
||
| 231 | 231 | return false; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - if ( ! $_POST || ! isset( $_POST['field_options'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 234 | + if ( ! $_POST || ! isset( $_POST['field_options'] ) ) { |
|
| 235 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 235 | 236 | return false; |
| 236 | 237 | } |
| 237 | 238 | |
@@ -338,7 +339,8 @@ discard block |
||
| 338 | 339 | * @return void |
| 339 | 340 | */ |
| 340 | 341 | private static function get_posted_field_setting( $setting, &$value ) { |
| 341 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 342 | + if ( ! isset( $_POST['field_options'][ $setting ] ) ) { |
|
| 343 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 342 | 344 | return; |
| 343 | 345 | } |
| 344 | 346 | |
@@ -1531,7 +1533,8 @@ discard block |
||
| 1531 | 1533 | |
| 1532 | 1534 | // Check posted vals before checking saved values |
| 1533 | 1535 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1534 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1536 | + if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { |
|
| 1537 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1535 | 1538 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1536 | 1539 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1537 | 1540 | $other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
@@ -1542,7 +1545,8 @@ discard block |
||
| 1542 | 1545 | return $other_val; |
| 1543 | 1546 | } |
| 1544 | 1547 | |
| 1545 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1548 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { |
|
| 1549 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1546 | 1550 | // For normal fields |
| 1547 | 1551 | |
| 1548 | 1552 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | * @return void |
| 47 | 47 | */ |
| 48 | 48 | private function _set( $param, $atts ) { |
| 49 | - if ( isset( $atts[ $param ] ) ) { |
|
| 50 | - $this->{$param} = $atts[ $param ]; |
|
| 49 | + if ( isset( $atts[$param] ) ) { |
|
| 50 | + $this->{$param} = $atts[$param]; |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $exclude = array( 'field_obj', 'html' ); |
| 99 | 99 | foreach ( $exclude as $ex ) { |
| 100 | - if ( isset( $atts[ $ex ] ) ) { |
|
| 101 | - unset( $this->pass_args[ $ex ] ); |
|
| 100 | + if ( isset( $atts[$ex] ) ) { |
|
| 101 | + unset( $this->pass_args[$ex] ); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | * @return void |
| 113 | 113 | */ |
| 114 | 114 | private function set_from_field( $atts, $set ) { |
| 115 | - if ( isset( $atts[ $set['param'] ] ) ) { |
|
| 116 | - $this->{$set['param']} = $atts[ $set['param'] ]; |
|
| 115 | + if ( isset( $atts[$set['param']] ) ) { |
|
| 116 | + $this->{$set['param']} = $atts[$set['param']]; |
|
| 117 | 117 | } else { |
| 118 | 118 | $this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] ); |
| 119 | 119 | } |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | */ |
| 265 | 265 | private function replace_error_shortcode() { |
| 266 | 266 | $this->maybe_add_error_id(); |
| 267 | - $error = $this->pass_args['errors'][ 'field' . $this->field_id ] ?? false; |
|
| 267 | + $error = $this->pass_args['errors']['field' . $this->field_id] ?? false; |
|
| 268 | 268 | |
| 269 | 269 | if ( ! empty( $error ) && false === strpos( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) { |
| 270 | 270 | $error_body = self::get_error_body( $this->html ); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | * @return void |
| 308 | 308 | */ |
| 309 | 309 | private function maybe_add_error_id() { |
| 310 | - if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 310 | + if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 311 | 311 | return; |
| 312 | 312 | } |
| 313 | 313 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER ); |
| 400 | 400 | |
| 401 | 401 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 402 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 402 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 403 | 403 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 404 | 404 | |
| 405 | 405 | $replace_with = ''; |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | $replace_with = $this->replace_input_shortcode( $shortcode_atts ); |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | - $this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html ); |
|
| 413 | + $this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html ); |
|
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | */ |
| 433 | 433 | private function prepare_input_shortcode_atts( $shortcode_atts ) { |
| 434 | 434 | if ( isset( $shortcode_atts['opt'] ) ) { |
| 435 | - --$shortcode_atts['opt']; |
|
| 435 | + -- $shortcode_atts['opt']; |
|
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | $field_class = $shortcode_atts['class'] ?? ''; |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | */ |
| 503 | 503 | private function get_field_div_classes() { |
| 504 | 504 | // Add error class |
| 505 | - $classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : ''; |
|
| 505 | + $classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : ''; |
|
| 506 | 506 | |
| 507 | 507 | // Add label position class |
| 508 | 508 | $settings = $this->field_obj->display_field_settings(); |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | // Add 'aria-invalid' attribute to the group if there are errors. |
| 586 | - if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 586 | + if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 587 | 587 | $attributes['aria-invalid'] = 'true'; |
| 588 | 588 | } |
| 589 | 589 | |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | $field_val = ''; |
| 161 | 161 | if ( is_object( $this->field ) ) { |
| 162 | 162 | $field_val = $this->field->{$column}; |
| 163 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
| 164 | - $field_val = $this->field[ $column ]; |
|
| 163 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
| 164 | + $field_val = $this->field[$column]; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | return $field_val; |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | if ( is_object( $this->field ) ) { |
| 178 | 178 | $this->field->{$column} = $value; |
| 179 | 179 | } elseif ( is_array( $this->field ) ) { |
| 180 | - $this->field[ $column ] = $value; |
|
| 180 | + $this->field[$column] = $value; |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | printf( |
| 724 | 724 | /* translators: %s: Field type */ |
| 725 | 725 | esc_html__( '%s Options', 'formidable' ), |
| 726 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
| 726 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
| 727 | 727 | ); |
| 728 | 728 | FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) ); |
| 729 | 729 | ?> |
@@ -832,7 +832,7 @@ discard block |
||
| 832 | 832 | * @return array |
| 833 | 833 | */ |
| 834 | 834 | public function get_new_field_defaults() { |
| 835 | - $field = array( |
|
| 835 | + $field = array( |
|
| 836 | 836 | 'name' => $this->get_new_field_name(), |
| 837 | 837 | 'description' => '', |
| 838 | 838 | 'type' => $this->type, |
@@ -863,8 +863,8 @@ discard block |
||
| 863 | 863 | |
| 864 | 864 | $fields = array_merge( $fields, $pro_fields ); |
| 865 | 865 | |
| 866 | - if ( isset( $fields[ $this->type ] ) ) { |
|
| 867 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
| 866 | + if ( isset( $fields[$this->type] ) ) { |
|
| 867 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
| 868 | 868 | } |
| 869 | 869 | |
| 870 | 870 | return $name; |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | * @return array |
| 882 | 882 | */ |
| 883 | 883 | public function get_default_field_options() { |
| 884 | - $opts = array( |
|
| 884 | + $opts = array( |
|
| 885 | 885 | 'size' => '', |
| 886 | 886 | 'max' => '', |
| 887 | 887 | 'label' => '', |
@@ -1135,7 +1135,7 @@ discard block |
||
| 1135 | 1135 | * @return void |
| 1136 | 1136 | */ |
| 1137 | 1137 | public function set_aria_invalid_error( &$shortcode_atts, $args ) { |
| 1138 | - $shortcode_atts['aria-invalid'] = isset( $args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false'; |
|
| 1138 | + $shortcode_atts['aria-invalid'] = isset( $args['errors']['field' . $this->field_id] ) ? 'true' : 'false'; |
|
| 1139 | 1139 | } |
| 1140 | 1140 | |
| 1141 | 1141 | /** |
@@ -1316,11 +1316,11 @@ discard block |
||
| 1316 | 1316 | } |
| 1317 | 1317 | |
| 1318 | 1318 | $options = array_values( $this->field['options'] ); |
| 1319 | - if ( ! isset( $options[ $opt ] ) ) { |
|
| 1319 | + if ( ! isset( $options[$opt] ) ) { |
|
| 1320 | 1320 | return $hidden; |
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | - $option = $options[ $opt ]; |
|
| 1323 | + $option = $options[$opt]; |
|
| 1324 | 1324 | if ( is_array( $option ) ) { |
| 1325 | 1325 | $option = $option['value']; |
| 1326 | 1326 | } |
@@ -1403,8 +1403,8 @@ discard block |
||
| 1403 | 1403 | $selected = $values['field_value']; |
| 1404 | 1404 | |
| 1405 | 1405 | if ( isset( $values['combo_name'] ) ) { |
| 1406 | - $options = $options[ $values['combo_name'] ]; |
|
| 1407 | - $selected = is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ? $selected[ $values['combo_name'] ] : ''; |
|
| 1406 | + $options = $options[$values['combo_name']]; |
|
| 1407 | + $selected = is_array( $selected ) && isset( $selected[$values['combo_name']] ) ? $selected[$values['combo_name']] : ''; |
|
| 1408 | 1408 | } |
| 1409 | 1409 | |
| 1410 | 1410 | $input = $this->select_tag( $values ); |
@@ -1474,7 +1474,7 @@ discard block |
||
| 1474 | 1474 | * @return array |
| 1475 | 1475 | */ |
| 1476 | 1476 | protected function fill_display_field_values( $args = array() ) { |
| 1477 | - $defaults = array( |
|
| 1477 | + $defaults = array( |
|
| 1478 | 1478 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
| 1479 | 1479 | 'field_id' => $this->get_field_column( 'id' ), |
| 1480 | 1480 | 'field_plus_id' => '', |
@@ -1536,7 +1536,7 @@ discard block |
||
| 1536 | 1536 | } |
| 1537 | 1537 | } |
| 1538 | 1538 | |
| 1539 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
| 1539 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
| 1540 | 1540 | if ( $error_comes_first ) { |
| 1541 | 1541 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
| 1542 | 1542 | } else { |
@@ -1618,11 +1618,11 @@ discard block |
||
| 1618 | 1618 | |
| 1619 | 1619 | $field_id = $this->get_field_column( 'id' ); |
| 1620 | 1620 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
| 1621 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
| 1621 | + $frm_validated_unique_values[$field_id] = array(); |
|
| 1622 | 1622 | return false; |
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
| 1625 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
| 1626 | 1626 | return $already_validated_this_value; |
| 1627 | 1627 | } |
| 1628 | 1628 | |
@@ -1649,7 +1649,7 @@ discard block |
||
| 1649 | 1649 | private function value_validated_as_unique( $value ) { |
| 1650 | 1650 | global $frm_validated_unique_values; |
| 1651 | 1651 | $field_id = $this->get_field_column( 'id' ); |
| 1652 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
| 1652 | + $frm_validated_unique_values[$field_id][] = $value; |
|
| 1653 | 1653 | } |
| 1654 | 1654 | |
| 1655 | 1655 | /** |
@@ -1694,8 +1694,8 @@ discard block |
||
| 1694 | 1694 | $value = $this->prepare_display_value( $value, $atts ); |
| 1695 | 1695 | |
| 1696 | 1696 | if ( is_array( $value ) ) { |
| 1697 | - if ( ! empty( $atts['show'] ) && isset( $value[ $atts['show'] ] ) ) { |
|
| 1698 | - $value = $value[ $atts['show'] ]; |
|
| 1697 | + if ( ! empty( $atts['show'] ) && isset( $value[$atts['show']] ) ) { |
|
| 1698 | + $value = $value[$atts['show']]; |
|
| 1699 | 1699 | } elseif ( empty( $atts['return_array'] ) ) { |
| 1700 | 1700 | $sep = $atts['sep'] ?? ', '; |
| 1701 | 1701 | $value = FrmAppHelper::safe_implode( $sep, $value ); |
@@ -1825,8 +1825,8 @@ discard block |
||
| 1825 | 1825 | $saved_entries = $atts['ids']; |
| 1826 | 1826 | $new_value = array(); |
| 1827 | 1827 | foreach ( (array) $value as $old_child_id ) { |
| 1828 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
| 1829 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
| 1828 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
| 1829 | + $new_value[] = $saved_entries[$old_child_id]; |
|
| 1830 | 1830 | } |
| 1831 | 1831 | } |
| 1832 | 1832 | |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | $conditionally_add = array( 'include_fields', 'fields', 'exclude_fields', 'entry' ); |
| 171 | 171 | foreach ( $conditionally_add as $index ) { |
| 172 | - if ( isset( $atts[ $index ] ) ) { |
|
| 173 | - $entry_atts[ $index ] = $atts[ $index ]; |
|
| 172 | + if ( isset( $atts[$index] ) ) { |
|
| 173 | + $entry_atts[$index] = $atts[$index]; |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | |
| 377 | 377 | $unset = array( 'id', 'form_id', 'format' ); |
| 378 | 378 | foreach ( $unset as $param ) { |
| 379 | - if ( isset( $atts[ $param ] ) ) { |
|
| 380 | - unset( $atts[ $param ] ); |
|
| 379 | + if ( isset( $atts[$param] ) ) { |
|
| 380 | + unset( $atts[$param] ); |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | |
@@ -553,11 +553,11 @@ discard block |
||
| 553 | 553 | |
| 554 | 554 | $displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() ); |
| 555 | 555 | |
| 556 | - $output[ $this->get_key_or_id( $field_value ) ] = $displayed_value; |
|
| 556 | + $output[$this->get_key_or_id( $field_value )] = $displayed_value; |
|
| 557 | 557 | |
| 558 | 558 | $has_separate_value = (bool) $field_value->get_field_option( 'separate_value' ); |
| 559 | 559 | if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) { |
| 560 | - $output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value(); |
|
| 560 | + $output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value(); |
|
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | 563 | } |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | if ( $this->is_plain_text ) { |
| 976 | 976 | if ( is_array( $value ) ) { |
| 977 | 977 | foreach ( $value as $key => $single_value ) { |
| 978 | - $value[ $key ] = $this->strip_html( $single_value ); |
|
| 978 | + $value[$key] = $this->strip_html( $single_value ); |
|
| 979 | 979 | } |
| 980 | 980 | } elseif ( $this->is_plain_text && ! is_array( $value ) ) { |
| 981 | 981 | if ( strpos( $value, '<img' ) !== false ) { |