@@ -235,7 +235,7 @@ |
||
235 | 235 | if ( is_array( $upsell ) ) { |
236 | 236 | foreach ( $upsell as $k => $plugin ) { |
237 | 237 | if ( strpos( $plugin['slug'], 'wpforms' ) !== false ) { |
238 | - unset( $upsell[ $k ] ); |
|
238 | + unset( $upsell[$k] ); |
|
239 | 239 | } |
240 | 240 | } |
241 | 241 | } |
@@ -129,11 +129,11 @@ discard block |
||
129 | 129 | <?php } ?> |
130 | 130 | |
131 | 131 | .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_minus_icon:before{ |
132 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['-'] : $minus_icons[1]['-'] ); ?>"; |
|
132 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['-'] : $minus_icons[1]['-'] ); ?>"; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_plus_icon:before{ |
136 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['+'] : $minus_icons[1]['+'] ); ?>"; |
|
136 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['+'] : $minus_icons[1]['+'] ); ?>"; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_minus_icon:before, |
@@ -145,14 +145,14 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | .<?php echo esc_html( $style_class ); ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{ |
148 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['-'] : $arrow_icons[1]['-'] ); ?>"; |
|
148 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['-'] : $arrow_icons[1]['-'] ); ?>"; |
|
149 | 149 | <?php if ( ! empty( $section_color ) ) { ?> |
150 | 150 | color:<?php echo esc_html( $section_color . $important ); ?>; |
151 | 151 | <?php } ?> |
152 | 152 | } |
153 | 153 | |
154 | 154 | .<?php echo esc_html( $style_class ); ?> .frm_trigger .frm_icon_font.frm_arrow_icon:before{ |
155 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['+'] : $arrow_icons[1]['+'] ); ?>"; |
|
155 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['+'] : $arrow_icons[1]['+'] ); ?>"; |
|
156 | 156 | <?php if ( ! empty( $section_color ) ) { ?> |
157 | 157 | color:<?php echo esc_html( $section_color . $important ); ?>; |
158 | 158 | <?php } ?> |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | 'fill' => '#4d4d4d', |
151 | 151 | 'orange' => '#f05a24', |
152 | 152 | ); |
153 | - $atts = array_merge( $defaults, $atts ); |
|
153 | + $atts = array_merge( $defaults, $atts ); |
|
154 | 154 | |
155 | 155 | 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'] ) . '"> |
156 | 156 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | * @return string |
350 | 350 | */ |
351 | 351 | public static function get_server_value( $value ) { |
352 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
352 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | /** |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | ); |
373 | 373 | $ip = ''; |
374 | 374 | foreach ( $ip_options as $key ) { |
375 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
375 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
376 | 376 | continue; |
377 | 377 | } |
378 | 378 | |
@@ -397,10 +397,10 @@ discard block |
||
397 | 397 | |
398 | 398 | if ( $src == 'get' ) { |
399 | 399 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
400 | - $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); |
|
401 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { |
|
400 | + $value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default ); |
|
401 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { |
|
402 | 402 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
403 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
403 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
404 | 404 | } |
405 | 405 | self::sanitize_value( $sanitize, $value ); |
406 | 406 | } else { |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | } |
422 | 422 | |
423 | 423 | $p = trim( $p, ']' ); |
424 | - $value = isset( $value[ $p ] ) ? $value[ $p ] : $default; |
|
424 | + $value = isset( $value[$p] ) ? $value[$p] : $default; |
|
425 | 425 | } |
426 | 426 | } |
427 | 427 | |
@@ -477,26 +477,26 @@ discard block |
||
477 | 477 | 'sanitize' => 'sanitize_text_field', |
478 | 478 | 'serialized' => false, |
479 | 479 | ); |
480 | - $args = wp_parse_args( $args, $defaults ); |
|
480 | + $args = wp_parse_args( $args, $defaults ); |
|
481 | 481 | |
482 | 482 | $value = $args['default']; |
483 | 483 | if ( $args['type'] == 'get' ) { |
484 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
484 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
485 | 485 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
486 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
486 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
487 | 487 | } |
488 | 488 | } elseif ( $args['type'] == 'post' ) { |
489 | - if ( isset( $_POST[ $args['param'] ] ) ) { |
|
489 | + if ( isset( $_POST[$args['param']] ) ) { |
|
490 | 490 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
491 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
491 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
492 | 492 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
493 | 493 | self::unserialize_or_decode( $value ); |
494 | 494 | } |
495 | 495 | } |
496 | 496 | } else { |
497 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
497 | + if ( isset( $_REQUEST[$args['param']] ) ) { |
|
498 | 498 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
499 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
499 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
500 | 500 | } |
501 | 501 | } |
502 | 502 | |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | if ( is_array( $value ) ) { |
529 | 529 | $temp_values = $value; |
530 | 530 | foreach ( $temp_values as $k => $v ) { |
531 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
531 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
532 | 532 | } |
533 | 533 | } else { |
534 | 534 | $value = call_user_func( $sanitize, $value ); |
@@ -539,8 +539,8 @@ discard block |
||
539 | 539 | public static function sanitize_request( $sanitize_method, &$values ) { |
540 | 540 | $temp_values = $values; |
541 | 541 | foreach ( $temp_values as $k => $val ) { |
542 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
543 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
542 | + if ( isset( $sanitize_method[$k] ) ) { |
|
543 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
544 | 544 | } |
545 | 545 | } |
546 | 546 | } |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | if ( is_array( $value ) ) { |
564 | 564 | $temp_values = $value; |
565 | 565 | foreach ( $temp_values as $k => $v ) { |
566 | - self::decode_specialchars( $value[ $k ] ); |
|
566 | + self::decode_specialchars( $value[$k] ); |
|
567 | 567 | } |
568 | 568 | } else { |
569 | 569 | self::decode_amp( $value ); |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | $allowed_html = $html; |
641 | 641 | } elseif ( ! empty( $allowed ) ) { |
642 | 642 | foreach ( (array) $allowed as $a ) { |
643 | - $allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array(); |
|
643 | + $allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array(); |
|
644 | 644 | } |
645 | 645 | } |
646 | 646 | |
@@ -797,8 +797,8 @@ discard block |
||
797 | 797 | } |
798 | 798 | |
799 | 799 | global $wp_query; |
800 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
801 | - $value = $wp_query->query_vars[ $param ]; |
|
800 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
801 | + $value = $wp_query->query_vars[$param]; |
|
802 | 802 | } |
803 | 803 | |
804 | 804 | return $value; |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | 'new_file_path' => self::plugin_path() . '/js', |
966 | 966 | ) |
967 | 967 | ); |
968 | - $new_file = new FrmCreateFile( $file_atts ); |
|
968 | + $new_file = new FrmCreateFile( $file_atts ); |
|
969 | 969 | |
970 | 970 | $files = array( |
971 | 971 | self::plugin_path() . '/js/jquery/jquery.placeholder.min.js', |
@@ -1277,8 +1277,8 @@ discard block |
||
1277 | 1277 | return $error; |
1278 | 1278 | } |
1279 | 1279 | |
1280 | - $nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
1281 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1280 | + $nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
1281 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1282 | 1282 | $frm_settings = self::get_settings(); |
1283 | 1283 | $error = $frm_settings->admin_permission; |
1284 | 1284 | } |
@@ -1313,7 +1313,7 @@ discard block |
||
1313 | 1313 | } else { |
1314 | 1314 | foreach ( $value as $k => $v ) { |
1315 | 1315 | if ( ! is_array( $v ) ) { |
1316 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
1316 | + $value[$k] = call_user_func( $original_function, $v ); |
|
1317 | 1317 | } |
1318 | 1318 | } |
1319 | 1319 | } |
@@ -1338,7 +1338,7 @@ discard block |
||
1338 | 1338 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
1339 | 1339 | } else { |
1340 | 1340 | if ( $keys == 'keep' ) { |
1341 | - $return[ $key ] = $value; |
|
1341 | + $return[$key] = $value; |
|
1342 | 1342 | } else { |
1343 | 1343 | $return[] = $value; |
1344 | 1344 | } |
@@ -1402,11 +1402,11 @@ discard block |
||
1402 | 1402 | } |
1403 | 1403 | |
1404 | 1404 | $ver = $default; |
1405 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
1405 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
1406 | 1406 | return $ver; |
1407 | 1407 | } |
1408 | 1408 | |
1409 | - $query = $wp_scripts->registered[ $handle ]; |
|
1409 | + $query = $wp_scripts->registered[$handle]; |
|
1410 | 1410 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
1411 | 1411 | $ver = $query->ver; |
1412 | 1412 | } |
@@ -1529,7 +1529,7 @@ discard block |
||
1529 | 1529 | |
1530 | 1530 | foreach ( array( 'name', 'description' ) as $var ) { |
1531 | 1531 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
1532 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
1532 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
1533 | 1533 | unset( $var, $default_val ); |
1534 | 1534 | } |
1535 | 1535 | |
@@ -1587,9 +1587,9 @@ discard block |
||
1587 | 1587 | } |
1588 | 1588 | } |
1589 | 1589 | |
1590 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
1591 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
1592 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
1590 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
1591 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
1592 | + $new_value = $post_values['item_meta'][$field->id]; |
|
1593 | 1593 | self::unserialize_or_decode( $new_value ); |
1594 | 1594 | } else { |
1595 | 1595 | $new_value = $meta_value; |
@@ -1610,7 +1610,7 @@ discard block |
||
1610 | 1610 | |
1611 | 1611 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
1612 | 1612 | |
1613 | - $values['fields'][ $field->id ] = $field_array; |
|
1613 | + $values['fields'][$field->id] = $field_array; |
|
1614 | 1614 | } |
1615 | 1615 | |
1616 | 1616 | /** |
@@ -1657,11 +1657,11 @@ discard block |
||
1657 | 1657 | } |
1658 | 1658 | |
1659 | 1659 | foreach ( $form->options as $opt => $value ) { |
1660 | - if ( isset( $post_values[ $opt ] ) ) { |
|
1661 | - $values[ $opt ] = $post_values[ $opt ]; |
|
1662 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
1660 | + if ( isset( $post_values[$opt] ) ) { |
|
1661 | + $values[$opt] = $post_values[$opt]; |
|
1662 | + self::unserialize_or_decode( $values[$opt] ); |
|
1663 | 1663 | } else { |
1664 | - $values[ $opt ] = $value; |
|
1664 | + $values[$opt] = $value; |
|
1665 | 1665 | } |
1666 | 1666 | } |
1667 | 1667 | |
@@ -1675,8 +1675,8 @@ discard block |
||
1675 | 1675 | $form_defaults = FrmFormsHelper::get_default_opts(); |
1676 | 1676 | |
1677 | 1677 | foreach ( $form_defaults as $opt => $default ) { |
1678 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
1679 | - $values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default; |
|
1678 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
1679 | + $values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default; |
|
1680 | 1680 | } |
1681 | 1681 | |
1682 | 1682 | unset( $opt, $default ); |
@@ -1687,8 +1687,8 @@ discard block |
||
1687 | 1687 | } |
1688 | 1688 | |
1689 | 1689 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
1690 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
1691 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
1690 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
1691 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
1692 | 1692 | } |
1693 | 1693 | unset( $h ); |
1694 | 1694 | } |
@@ -1840,25 +1840,25 @@ discard block |
||
1840 | 1840 | if ( ! is_numeric( $levels ) ) { |
1841 | 1841 | // Show time in specified unit. |
1842 | 1842 | $levels = self::get_unit( $levels ); |
1843 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
1843 | + if ( isset( $time_strings[$levels] ) ) { |
|
1844 | 1844 | $diff = array( |
1845 | 1845 | $levels => self::time_format( $levels, $diff ), |
1846 | 1846 | ); |
1847 | 1847 | $time_strings = array( |
1848 | - $levels => $time_strings[ $levels ], |
|
1848 | + $levels => $time_strings[$levels], |
|
1849 | 1849 | ); |
1850 | 1850 | } |
1851 | 1851 | $levels = 1; |
1852 | 1852 | } |
1853 | 1853 | |
1854 | 1854 | foreach ( $time_strings as $k => $v ) { |
1855 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
1856 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
1857 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
1855 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
1856 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
1857 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
1858 | 1858 | // Account for 0. |
1859 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
1859 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
1860 | 1860 | } else { |
1861 | - unset( $time_strings[ $k ] ); |
|
1861 | + unset( $time_strings[$k] ); |
|
1862 | 1862 | } |
1863 | 1863 | } |
1864 | 1864 | |
@@ -1877,8 +1877,8 @@ discard block |
||
1877 | 1877 | 'y' => 'y', |
1878 | 1878 | 'd' => 'days', |
1879 | 1879 | ); |
1880 | - if ( isset( $return[ $unit ] ) ) { |
|
1881 | - return $diff[ $return[ $unit ] ]; |
|
1880 | + if ( isset( $return[$unit] ) ) { |
|
1881 | + return $diff[$return[$unit]]; |
|
1882 | 1882 | } |
1883 | 1883 | |
1884 | 1884 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -1886,11 +1886,11 @@ discard block |
||
1886 | 1886 | $times = array( 'h', 'i', 's' ); |
1887 | 1887 | |
1888 | 1888 | foreach ( $times as $time ) { |
1889 | - if ( ! isset( $diff[ $time ] ) ) { |
|
1889 | + if ( ! isset( $diff[$time] ) ) { |
|
1890 | 1890 | continue; |
1891 | 1891 | } |
1892 | 1892 | |
1893 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
1893 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
1894 | 1894 | } |
1895 | 1895 | |
1896 | 1896 | return floor( $total ); |
@@ -1910,7 +1910,7 @@ discard block |
||
1910 | 1910 | 'y' => DAY_IN_SECONDS * 365.25, |
1911 | 1911 | ); |
1912 | 1912 | |
1913 | - return $convert[ $from ] / $convert[ $to ]; |
|
1913 | + return $convert[$from] / $convert[$to]; |
|
1914 | 1914 | } |
1915 | 1915 | |
1916 | 1916 | /** |
@@ -1918,7 +1918,7 @@ discard block |
||
1918 | 1918 | */ |
1919 | 1919 | private static function get_unit( $unit ) { |
1920 | 1920 | $units = self::get_time_strings(); |
1921 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
1921 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
1922 | 1922 | return $unit; |
1923 | 1923 | } |
1924 | 1924 | |
@@ -1999,17 +1999,17 @@ discard block |
||
1999 | 1999 | |
2000 | 2000 | case 1: |
2001 | 2001 | $l2 = $name; |
2002 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
2002 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
2003 | 2003 | break; |
2004 | 2004 | |
2005 | 2005 | case 2: |
2006 | 2006 | $l3 = $name; |
2007 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
2007 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
2008 | 2008 | break; |
2009 | 2009 | |
2010 | 2010 | case 3: |
2011 | 2011 | $l4 = $name; |
2012 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
2012 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
2013 | 2013 | } |
2014 | 2014 | |
2015 | 2015 | unset( $this_val, $n ); |
@@ -2028,8 +2028,8 @@ discard block |
||
2028 | 2028 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
2029 | 2029 | if ( $name == '' ) { |
2030 | 2030 | $vars[] = $val; |
2031 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
2032 | - $vars[ $l1 ] = $val; |
|
2031 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
2032 | + $vars[$l1] = $val; |
|
2033 | 2033 | } |
2034 | 2034 | } |
2035 | 2035 | |
@@ -2045,7 +2045,7 @@ discard block |
||
2045 | 2045 | 'email_subject' => esc_attr( sprintf( __( 'If you leave the subject blank, the default will be used: %1$s Form submitted on %2$s', 'formidable' ), $form_name, self::site_name() ) ), |
2046 | 2046 | ); |
2047 | 2047 | |
2048 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
2048 | + if ( ! isset( $tooltips[$name] ) ) { |
|
2049 | 2049 | return; |
2050 | 2050 | } |
2051 | 2051 | |
@@ -2055,7 +2055,7 @@ discard block |
||
2055 | 2055 | echo ' class="frm_help"'; |
2056 | 2056 | } |
2057 | 2057 | |
2058 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
2058 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
2059 | 2059 | |
2060 | 2060 | if ( 'open' != $class ) { |
2061 | 2061 | echo '"'; |
@@ -2108,13 +2108,13 @@ discard block |
||
2108 | 2108 | } |
2109 | 2109 | |
2110 | 2110 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
2111 | - if ( ! isset( $post_content[ $key ] ) ) { |
|
2111 | + if ( ! isset( $post_content[$key] ) ) { |
|
2112 | 2112 | return; |
2113 | 2113 | } |
2114 | 2114 | |
2115 | 2115 | if ( is_array( $val ) ) { |
2116 | 2116 | foreach ( $val as $k1 => $v1 ) { |
2117 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
2117 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
2118 | 2118 | unset( $k1, $v1 ); |
2119 | 2119 | } |
2120 | 2120 | } else { |
@@ -2122,7 +2122,7 @@ discard block |
||
2122 | 2122 | $val = stripslashes( $val ); |
2123 | 2123 | |
2124 | 2124 | // Add backslashes before double quotes and forward slashes only |
2125 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
2125 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
2126 | 2126 | } |
2127 | 2127 | } |
2128 | 2128 | |
@@ -2181,14 +2181,14 @@ discard block |
||
2181 | 2181 | continue; |
2182 | 2182 | } |
2183 | 2183 | $key = $input['name']; |
2184 | - if ( isset( $formatted[ $key ] ) ) { |
|
2185 | - if ( is_array( $formatted[ $key ] ) ) { |
|
2186 | - $formatted[ $key ][] = $input['value']; |
|
2184 | + if ( isset( $formatted[$key] ) ) { |
|
2185 | + if ( is_array( $formatted[$key] ) ) { |
|
2186 | + $formatted[$key][] = $input['value']; |
|
2187 | 2187 | } else { |
2188 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
2188 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
2189 | 2189 | } |
2190 | 2190 | } else { |
2191 | - $formatted[ $key ] = $input['value']; |
|
2191 | + $formatted[$key] = $input['value']; |
|
2192 | 2192 | } |
2193 | 2193 | } |
2194 | 2194 |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | $show_intervals = array( 50, 200, 500 ); |
72 | 72 | $asked = $this->review_status['asked']; |
73 | 73 | |
74 | - if ( ! isset( $show_intervals[ $asked ] ) ) { |
|
74 | + if ( ! isset( $show_intervals[$asked] ) ) { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 | |
78 | 78 | $entries = FrmEntry::getRecordCount(); |
79 | - $count = $show_intervals[ $asked ]; |
|
79 | + $count = $show_intervals[$asked]; |
|
80 | 80 | $user = wp_get_current_user(); |
81 | 81 | |
82 | 82 | // Only show review request if the site has collected enough entries |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $requests = $message->get_messages(); |
119 | 119 | $key = $this->inbox_key . ( $asked ? $asked : '' ); |
120 | 120 | |
121 | - if ( isset( $requests[ $key ] ) ) { |
|
121 | + if ( isset( $requests[$key] ) ) { |
|
122 | 122 | return; |
123 | 123 | } |
124 | 124 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @since 4.05.02 |
155 | 155 | */ |
156 | 156 | private function has_later_request( $requests, $asked ) { |
157 | - return isset( $requests[ $this->inbox_key . ( $asked + 1 ) ] ) || isset( $requests[ $this->inbox_key . ( $asked + 2 ) ] ); |
|
157 | + return isset( $requests[$this->inbox_key . ( $asked + 1 )] ) || isset( $requests[$this->inbox_key . ( $asked + 2 )] ); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | '-' => 'down', |
192 | 192 | '+' => 'up', |
193 | 193 | ); |
194 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
194 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
195 | 195 | } else { |
196 | 196 | //frm_minus1_icon |
197 | 197 | $key = str_replace( 'p', '', $key ); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | '-' => 'minus', |
200 | 200 | '+' => 'plus', |
201 | 201 | ); |
202 | - $class = 'frm_' . $plus[ $icon ]; |
|
202 | + $class = 'frm_' . $plus[$icon]; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | if ( $key ) { |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | ?> |
220 | 220 | <div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select"> |
221 | 221 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
222 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?> |
|
223 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?> |
|
222 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?> |
|
223 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?> |
|
224 | 224 | <b class="caret"></b> |
225 | 225 | </button> |
226 | 226 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | <li <?php echo ( $style->post_content['collapse_icon'] == $key ) ? 'class="active"' : ''; ?>> |
229 | 229 | <a href="javascript:void(0);"> |
230 | 230 | <label> |
231 | - <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?>/> |
|
231 | + <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?>/> |
|
232 | 232 | <span> |
233 | 233 | <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); ?> |
234 | 234 | <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '-', $type ) ); ?> |
@@ -310,15 +310,15 @@ discard block |
||
310 | 310 | $vars = array_diff( $vars, $remove ); |
311 | 311 | |
312 | 312 | foreach ( $vars as $var ) { |
313 | - if ( ! isset( $settings[ $var ] ) ) { |
|
313 | + if ( ! isset( $settings[$var] ) ) { |
|
314 | 314 | continue; |
315 | 315 | } |
316 | - if ( ! isset( $defaults[ $var ] ) ) { |
|
317 | - $defaults[ $var ] = ''; |
|
316 | + if ( ! isset( $defaults[$var] ) ) { |
|
317 | + $defaults[$var] = ''; |
|
318 | 318 | } |
319 | - $show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] ); |
|
319 | + $show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] ); |
|
320 | 320 | if ( $show ) { |
321 | - echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[ $var ] ) : esc_html( $settings[ $var ] ) ) . ';'; // WPCS: XSS ok. |
|
321 | + echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[$var] ) : esc_html( $settings[$var] ) ) . ';'; // WPCS: XSS ok. |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | } |
@@ -358,14 +358,14 @@ discard block |
||
358 | 358 | $settings['style_class'] = 'frm_style_' . $style->post_name . '.'; |
359 | 359 | } |
360 | 360 | |
361 | - $settings['style_class'] .= 'with_frm_style'; |
|
361 | + $settings['style_class'] .= 'with_frm_style'; |
|
362 | 362 | $settings['font'] = stripslashes( $settings['font'] ); |
363 | 363 | $settings['change_margin'] = self::description_margin_for_screensize( $settings['width'] ); |
364 | 364 | |
365 | 365 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
366 | 366 | foreach ( $checkbox_opts as $opt ) { |
367 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
368 | - $settings[ $opt ] = 0; |
|
367 | + if ( ! isset( $settings[$opt] ) ) { |
|
368 | + $settings[$opt] = 0; |
|
369 | 369 | } |
370 | 370 | } |
371 | 371 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $css = ''; |
390 | 390 | } |
391 | 391 | foreach ( $opts as $opt ) { |
392 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
392 | + self::get_color_output( $css, $settings[$opt] ); |
|
393 | 393 | } |
394 | 394 | } |
395 | 395 | } |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | |
162 | 162 | $conditionally_add = array( 'include_fields', 'fields', 'exclude_fields', 'entry' ); |
163 | 163 | foreach ( $conditionally_add as $index ) { |
164 | - if ( isset( $atts[ $index ] ) ) { |
|
165 | - $entry_atts[ $index ] = $atts[ $index ]; |
|
164 | + if ( isset( $atts[$index] ) ) { |
|
165 | + $entry_atts[$index] = $atts[$index]; |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
@@ -331,8 +331,8 @@ discard block |
||
331 | 331 | |
332 | 332 | $unset = array( 'id', 'entry', 'form_id', 'format' ); |
333 | 333 | foreach ( $unset as $param ) { |
334 | - if ( isset( $atts[ $param ] ) ) { |
|
335 | - unset( $atts[ $param ] ); |
|
334 | + if ( isset( $atts[$param] ) ) { |
|
335 | + unset( $atts[$param] ); |
|
336 | 336 | } |
337 | 337 | } |
338 | 338 | |
@@ -485,11 +485,11 @@ discard block |
||
485 | 485 | |
486 | 486 | $displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() ); |
487 | 487 | |
488 | - $output[ $this->get_key_or_id( $field_value ) ] = $displayed_value; |
|
488 | + $output[$this->get_key_or_id( $field_value )] = $displayed_value; |
|
489 | 489 | |
490 | 490 | $has_separate_value = (bool) $field_value->get_field_option( 'separate_value' ); |
491 | 491 | if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) { |
492 | - $output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value(); |
|
492 | + $output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value(); |
|
493 | 493 | } |
494 | 494 | } |
495 | 495 | } |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | |
877 | 877 | if ( is_array( $value ) ) { |
878 | 878 | foreach ( $value as $key => $single_value ) { |
879 | - $value[ $key ] = $this->strip_html( $single_value ); |
|
879 | + $value[$key] = $this->strip_html( $single_value ); |
|
880 | 880 | } |
881 | 881 | } elseif ( $this->is_plain_text && ! is_array( $value ) ) { |
882 | 882 | if ( strpos( $value, '<img' ) !== false ) { |
@@ -125,7 +125,8 @@ |
||
125 | 125 | } |
126 | 126 | |
127 | 127 | // Only do this for single site installs. |
128 | - if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // WPCS: CSRF ok. |
|
128 | + if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { |
|
129 | +// WPCS: CSRF ok. |
|
129 | 130 | return; |
130 | 131 | } |
131 | 132 |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function add_settings( $sections ) { |
161 | 161 | wp_enqueue_style( 'formidable-pro-fields' ); |
162 | - $sections[ $this->plugin_slug ] = array( |
|
162 | + $sections[$this->plugin_slug] = array( |
|
163 | 163 | 'class' => $this, |
164 | 164 | 'function' => 'settings_page', |
165 | 165 | 'name' => $this->plugin_name(), |
@@ -316,9 +316,9 @@ discard block |
||
316 | 316 | // Set the current step. |
317 | 317 | if ( ! isset( $step['current'] ) ) { |
318 | 318 | if ( $step['complete'] ) { |
319 | - $steps[ $k ]['current'] = false; |
|
319 | + $steps[$k]['current'] = false; |
|
320 | 320 | } else { |
321 | - $steps[ $k ]['current'] = ! $has_current; |
|
321 | + $steps[$k]['current'] = ! $has_current; |
|
322 | 322 | $has_current = true; |
323 | 323 | } |
324 | 324 | } elseif ( $step['current'] ) { |
@@ -328,10 +328,10 @@ discard block |
||
328 | 328 | // Set disabled buttons. |
329 | 329 | $class = isset( $step['button_class'] ) ? $step['button_class'] : ''; |
330 | 330 | $class .= ' button-primary frm-button-primary'; |
331 | - if ( ! $steps[ $k ]['current'] ) { |
|
331 | + if ( ! $steps[$k]['current'] ) { |
|
332 | 332 | $class .= ' frm_grey disabled'; |
333 | 333 | } |
334 | - $steps[ $k ]['button_class'] = $class; |
|
334 | + $steps[$k]['button_class'] = $class; |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | return $steps; |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | if ( $plugin['status'] === 'active' ) { |
354 | 354 | continue; |
355 | 355 | } |
356 | - $links[ $plugin_key ] = $plugin; |
|
356 | + $links[$plugin_key] = $plugin; |
|
357 | 357 | if ( isset( $plugin['url'] ) ) { |
358 | 358 | $rel[] = $plugin['url']; |
359 | 359 | } else { |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | $addons = $api->get_api_info(); |
469 | 469 | |
470 | 470 | $id = $this->download_id(); |
471 | - $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] ); |
|
471 | + $has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] ); |
|
472 | 472 | |
473 | 473 | if ( ! $step['current'] ) { |
474 | 474 | ?> |
@@ -483,10 +483,10 @@ discard block |
||
483 | 483 | |
484 | 484 | if ( ! $has_file ) { |
485 | 485 | echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>'; |
486 | - } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) { |
|
486 | + } elseif ( ! isset( $addons[$id]['beta']['package'] ) ) { |
|
487 | 487 | echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>'; |
488 | 488 | } else { |
489 | - $xml = $addons[ $id ]['beta']['package']; |
|
489 | + $xml = $addons[$id]['beta']['package']; |
|
490 | 490 | if ( is_array( $xml ) ) { |
491 | 491 | $xml = reset( $xml ); |
492 | 492 | } |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | foreach ( $forms as $form ) { |
625 | 625 | $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false; |
626 | 626 | if ( $was_imported ) { |
627 | - $imported[ $form['form'] ] = $was_imported; |
|
627 | + $imported[$form['form']] = $was_imported; |
|
628 | 628 | } |
629 | 629 | } |
630 | 630 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | </h3> |
30 | 30 | <span class="frm_inbox_date"> |
31 | 31 | <?php |
32 | - if ( ! isset( $message['read'] ) || ! isset( $message['read'][ $user->ID ] ) ) { |
|
32 | + if ( ! isset( $message['read'] ) || ! isset( $message['read'][$user->ID] ) ) { |
|
33 | 33 | $inbox->mark_read( $key ); |
34 | 34 | ?> |
35 | 35 | <span class="frm_inbox_unread"></span> |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | if ( $_POST ) { |
118 | 118 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
119 | 119 | if ( $repeating ) { |
120 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { |
|
120 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { |
|
121 | 121 | $value_is_posted = true; |
122 | 122 | } |
123 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { |
|
123 | + } elseif ( isset( $_POST['item_meta'][$field->id] ) ) { |
|
124 | 124 | $value_is_posted = true; |
125 | 125 | } |
126 | 126 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER ); |
151 | 151 | |
152 | 152 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
153 | - $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
153 | + $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
154 | 154 | if ( ! empty( $add_atts ) ) { |
155 | 155 | $this_atts = array_merge( $atts, $add_atts ); |
156 | 156 | } else { |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | $default = FrmEntriesController::show_entry_shortcode( $this_atts ); |
161 | 161 | |
162 | 162 | // Add the default message. |
163 | - $message = str_replace( $shortcodes[0][ $short_key ], $default, $message ); |
|
163 | + $message = str_replace( $shortcodes[0][$short_key], $default, $message ); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | return $message; |
167 | 167 | } |
168 | 168 | |
169 | 169 | public static function prepare_display_value( $entry, $field, $atts ) { |
170 | - $field_value = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false; |
|
170 | + $field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false; |
|
171 | 171 | |
172 | 172 | if ( FrmAppHelper::pro_is_installed() ) { |
173 | 173 | $empty = empty( $field_value ); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ) ); |
191 | 191 | } else { |
192 | 192 | // Get all values for this field. |
193 | - $child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false; |
|
193 | + $child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false; |
|
194 | 194 | |
195 | 195 | if ( $child_values ) { |
196 | 196 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $value = $args['temp_value']; |
309 | 309 | } |
310 | 310 | if ( empty( $args['parent_field_id'] ) ) { |
311 | - $_POST['item_meta'][ $field->id ] = $value; |
|
311 | + $_POST['item_meta'][$field->id] = $value; |
|
312 | 312 | } else { |
313 | 313 | self::set_parent_field_posted_value( $field, $value, $args ); |
314 | 314 | } |
@@ -320,20 +320,20 @@ discard block |
||
320 | 320 | * @since 4.01 |
321 | 321 | */ |
322 | 322 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
323 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && |
|
324 | - is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { |
|
323 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && |
|
324 | + is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { |
|
325 | 325 | |
326 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || |
|
327 | - ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { |
|
328 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); |
|
326 | + if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || |
|
327 | + ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { |
|
328 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); |
|
329 | 329 | } |
330 | 330 | } else { |
331 | 331 | // All of the section was probably removed. |
332 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); |
|
333 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); |
|
332 | + $_POST['item_meta'][$args['parent_field_id']] = array(); |
|
333 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); |
|
334 | 334 | } |
335 | 335 | |
336 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; |
|
336 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | public static function get_posted_value( $field, &$value, $args ) { |
@@ -364,10 +364,10 @@ discard block |
||
364 | 364 | if ( empty( $args['parent_field_id'] ) ) { |
365 | 365 | // Sanitizing is done next. |
366 | 366 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
367 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; |
|
367 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; |
|
368 | 368 | } else { |
369 | 369 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
370 | - $value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; |
|
370 | + $value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; |
|
371 | 371 | } |
372 | 372 | return $value; |
373 | 373 | } |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | self::set_other_repeating_vals( $field, $value, $args ); |
399 | 399 | |
400 | 400 | // Check if there are any posted "Other" values. |
401 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { |
|
401 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { |
|
402 | 402 | |
403 | 403 | // Save original value. |
404 | 404 | $args['temp_value'] = $value; |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | |
407 | 407 | // Sanitizing is done next. |
408 | 408 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
409 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); |
|
409 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); |
|
410 | 410 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
411 | 411 | |
412 | 412 | // Set the validation value now |
@@ -429,13 +429,13 @@ discard block |
||
429 | 429 | } |
430 | 430 | |
431 | 431 | // Check if there are any other posted "other" values for this field. |
432 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { |
|
432 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { |
|
433 | 433 | // Save original value |
434 | 434 | $args['temp_value'] = $value; |
435 | 435 | $args['other'] = true; |
436 | 436 | |
437 | 437 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
438 | - $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); |
|
438 | + $other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); |
|
439 | 439 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
440 | 440 | |
441 | 441 | // Set the validation value now. |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
463 | 463 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
464 | 464 | foreach ( $other_vals as $k => $v ) { |
465 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
465 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
466 | 466 | // If the other box is checked, but doesn't have a value. |
467 | 467 | $value = ''; |
468 | 468 | break; |
@@ -479,25 +479,25 @@ discard block |
||
479 | 479 | |
480 | 480 | // Multi-select dropdown. |
481 | 481 | if ( is_array( $value ) ) { |
482 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
482 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
483 | 483 | |
484 | 484 | if ( $o_key !== false ) { |
485 | 485 | // Modify the original value so other key will be preserved. |
486 | - $value[ $other_key ] = $value[ $o_key ]; |
|
486 | + $value[$other_key] = $value[$o_key]; |
|
487 | 487 | |
488 | 488 | // By default, the array keys will be numeric for multi-select dropdowns. |
489 | 489 | // If going backwards and forwards between pages, the array key will match the other key. |
490 | 490 | if ( $o_key !== $other_key ) { |
491 | - unset( $value[ $o_key ] ); |
|
491 | + unset( $value[$o_key] ); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | $args['temp_value'] = $value; |
495 | - $value[ $other_key ] = reset( $other_vals ); |
|
496 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
497 | - unset( $value[ $other_key ] ); |
|
495 | + $value[$other_key] = reset( $other_vals ); |
|
496 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
497 | + unset( $value[$other_key] ); |
|
498 | 498 | } |
499 | 499 | } |
500 | - } elseif ( $field->options[ $other_key ] == $value ) { |
|
500 | + } elseif ( $field->options[$other_key] == $value ) { |
|
501 | 501 | $value = $other_vals; |
502 | 502 | } |
503 | 503 | } |