@@ -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 ) ) { |
@@ -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 ) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * @var array |
| 40 | 40 | */ |
| 41 | - protected $fields_map = array(); |
|
| 41 | + protected $fields_map = array(); |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * @var mixed |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | /** |
| 49 | 49 | * @var array |
| 50 | 50 | */ |
| 51 | - protected $current_section = array(); |
|
| 51 | + protected $current_section = array(); |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Define required properties. |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | // This may occasionally skip one level/order e.g. after adding a |
| 317 | 317 | // list field, as field_order would already be prepared to be used. |
| 318 | - ++$field_order; |
|
| 318 | + ++ $field_order; |
|
| 319 | 319 | |
| 320 | 320 | if ( ! empty( $new_field['fields'] ) && is_array( $new_field['fields'] ) ) { |
| 321 | 321 | // we have (inner) fields to merge |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | |
| 365 | 365 | $order = 0; |
| 366 | 366 | foreach ( $fields as $field ) { |
| 367 | - ++$order; |
|
| 367 | + ++ $order; |
|
| 368 | 368 | $type = $this->get_field_type( $field ); |
| 369 | 369 | $new_type = $this->convert_field_type( $type, $field ); |
| 370 | 370 | if ( ! in_array( $new_type, $with_end ) && $new_type !== 'break' ) { |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | $sub['name'] = __( 'Section Buttons', 'formidable' ); |
| 400 | 400 | $subs = array( $sub ); |
| 401 | 401 | $this->insert_fields_in_array( $subs, $order, 0, $fields ); |
| 402 | - ++$order; |
|
| 402 | + ++ $order; |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | /** |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | protected function create_fields( $form_id, &$form ) { |
| 514 | 514 | foreach ( $form['fields'] as $key => $new_field ) { |
| 515 | 515 | $new_field['form_id'] = $form_id; |
| 516 | - $form['fields'][ $key ]['id'] = FrmField::create( $new_field ); |
|
| 516 | + $form['fields'][$key]['id'] = FrmField::create( $new_field ); |
|
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | |
@@ -554,9 +554,9 @@ discard block |
||
| 554 | 554 | } elseif ( $key === 'the_post_title' ) { |
| 555 | 555 | $new_action->post_content['post_title'] = $value; |
| 556 | 556 | } elseif ( is_string( $value ) ) { |
| 557 | - $new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
| 557 | + $new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
| 558 | 558 | } else { |
| 559 | - $new_action->post_content[ $key ] = $value; |
|
| 559 | + $new_action->post_content[$key] = $value; |
|
| 560 | 560 | } |
| 561 | 561 | } |
| 562 | 562 | |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | |
| 578 | 578 | $imported = $this->get_tracked_import(); |
| 579 | 579 | |
| 580 | - $imported[ $this->slug ][ $new_form_id ] = $source_id; |
|
| 580 | + $imported[$this->slug][$new_form_id] = $source_id; |
|
| 581 | 581 | |
| 582 | 582 | update_option( $this->tracking, $imported, false ); |
| 583 | 583 | } |
@@ -597,11 +597,11 @@ discard block |
||
| 597 | 597 | private function is_imported( $source_id ) { |
| 598 | 598 | $imported = $this->get_tracked_import(); |
| 599 | 599 | $new_form_id = 0; |
| 600 | - if ( ! isset( $imported[ $this->slug ] ) || ! in_array( $source_id, $imported[ $this->slug ] ) ) { |
|
| 600 | + if ( ! isset( $imported[$this->slug] ) || ! in_array( $source_id, $imported[$this->slug] ) ) { |
|
| 601 | 601 | return $new_form_id; |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | - $new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) ); |
|
| 604 | + $new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) ); |
|
| 605 | 605 | if ( ! empty( $new_form_id ) && empty( FrmForm::get_key_by_id( $new_form_id ) ) ) { |
| 606 | 606 | // Allow reimport if the form was deleted. |
| 607 | 607 | $new_form_id = 0; |
@@ -33,12 +33,12 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * @var int |
| 35 | 35 | */ |
| 36 | - public $chmod_dir = 0755; |
|
| 36 | + public $chmod_dir = 0755; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * @var int |
| 40 | 40 | */ |
| 41 | - public $chmod_file = 0644; |
|
| 41 | + public $chmod_file = 0644; |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * @var bool |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | 'page' => '', |
| 46 | 46 | 'class' => 'frm-mt-0', |
| 47 | 47 | ); |
| 48 | - $tip = array_merge( $defaults, $tip ); |
|
| 48 | + $tip = array_merge( $defaults, $tip ); |
|
| 49 | 49 | |
| 50 | 50 | if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) { |
| 51 | 51 | $tip['link']['medium'] = 'tip'; |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | $random = random_int( 0, $count - 1 ); |
| 405 | - return $tips[ $random ]; |
|
| 405 | + return $tips[$random]; |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | /** |
@@ -152,13 +152,13 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | $is_setup_intent = 0 === strpos( $intent->id, 'seti_' ); |
| 154 | 154 | if ( $is_setup_intent ) { |
| 155 | - $errors[ 'field' . $cc_field_id ] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : ''; |
|
| 155 | + $errors['field' . $cc_field_id] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : ''; |
|
| 156 | 156 | } else { |
| 157 | - $errors[ 'field' . $cc_field_id ] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : ''; |
|
| 157 | + $errors['field' . $cc_field_id] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : ''; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - if ( ! $errors[ 'field' . $cc_field_id ] ) { |
|
| 161 | - $errors[ 'field' . $cc_field_id ] = 'Payment was not successfully processed.'; |
|
| 160 | + if ( ! $errors['field' . $cc_field_id] ) { |
|
| 161 | + $errors['field' . $cc_field_id] = 'Payment was not successfully processed.'; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | global $frm_vars; |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | $save_draft = ! empty( $form->options['save_draft'] ); |
| 188 | 188 | |
| 189 | 189 | global $frm_vars; |
| 190 | - $frm_vars['created_entries'][ $form_id ]['errors'] = $errors; |
|
| 190 | + $frm_vars['created_entries'][$form_id]['errors'] = $errors; |
|
| 191 | 191 | |
| 192 | 192 | // Set to true to get FrmProFieldsHelper::get_page_with_error() run. |
| 193 | - $_POST[ 'frm_page_order_' . $form_id ] = true; |
|
| 193 | + $_POST['frm_page_order_' . $form_id] = true; |
|
| 194 | 194 | |
| 195 | 195 | if ( ! $save_draft ) { |
| 196 | 196 | // If draft saving is not on, delete the entry. |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | // If draft saving is on, load the draft entry. |
| 202 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id; |
|
| 202 | + $frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id; |
|
| 203 | 203 | add_action( |
| 204 | 204 | 'frm_filter_final_form', |
| 205 | 205 | /** |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * |
| 211 | 211 | * @return string |
| 212 | 212 | */ |
| 213 | - function ( $html ) use ( $entry_id ) { |
|
| 213 | + function( $html ) use ( $entry_id ) { |
|
| 214 | 214 | global $wpdb; |
| 215 | 215 | $wpdb->update( $wpdb->prefix . 'frm_items', array( 'is_draft' => 1 ), array( 'id' => $entry_id ) ); |
| 216 | 216 | return $html; |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * |
| 27 | 27 | * @return void |
| 28 | 28 | */ |
| 29 | - function ( $frm_settings ) { |
|
| 29 | + function( $frm_settings ) { |
|
| 30 | 30 | $stripe_settings = FrmStrpLiteAppHelper::get_settings()->settings; |
| 31 | 31 | require FrmStrpLiteAppHelper::plugin_path() . '/views/settings/messages.php'; |
| 32 | 32 | } |
@@ -500,8 +500,8 @@ discard block |
||
| 500 | 500 | return $values; |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | - if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[ $field->id ] ) ) { |
|
| 504 | - $values['value'] = $previous_entry->metas[ $field->id ]; |
|
| 503 | + if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[$field->id] ) ) { |
|
| 504 | + $values['value'] = $previous_entry->metas[$field->id]; |
|
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | $frm_vars['trans_filled'] = true; |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | * |
| 539 | 539 | * @return void |
| 540 | 540 | */ |
| 541 | - function () use ( $entry_id, &$destroy_callback ) { |
|
| 541 | + function() use ( $entry_id, &$destroy_callback ) { |
|
| 542 | 542 | FrmEntry::destroy( $entry_id ); |
| 543 | 543 | // Only call this once. |
| 544 | 544 | remove_action( 'frm_entry_form', $destroy_callback ); |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | * @return array |
| 560 | 560 | */ |
| 561 | 561 | public static function before_save_settings( $settings, $action ) { |
| 562 | - $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); |
|
| 562 | + $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); |
|
| 563 | 563 | |
| 564 | 564 | if ( in_array( 'square', $settings['gateway'] ) ) { |
| 565 | 565 | $currency = FrmSquareLiteConnectHelper::get_merchant_currency(); |