@@ -76,10 +76,10 @@ |
||
76 | 76 | foreach ( $pro_fields as $field_key => $field_type ) { |
77 | 77 | |
78 | 78 | if ( isset( $field_type['section'] ) ) { |
79 | - if ( ! isset( $field_sections[ $field_type['section'] ] ) ) { |
|
80 | - $field_sections[ $field_type['section'] ] = array(); |
|
79 | + if ( ! isset( $field_sections[$field_type['section']] ) ) { |
|
80 | + $field_sections[$field_type['section']] = array(); |
|
81 | 81 | } |
82 | - $field_sections[ $field_type['section'] ][ $field_key ] = $field_type; |
|
82 | + $field_sections[$field_type['section']][$field_key] = $field_type; |
|
83 | 83 | continue; |
84 | 84 | } |
85 | 85 |
@@ -156,8 +156,8 @@ discard block |
||
156 | 156 | $field_val = ''; |
157 | 157 | if ( is_object( $this->field ) ) { |
158 | 158 | $field_val = $this->field->{$column}; |
159 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
160 | - $field_val = $this->field[ $column ]; |
|
159 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
160 | + $field_val = $this->field[$column]; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | return $field_val; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | if ( is_object( $this->field ) ) { |
172 | 172 | $this->field->{$column} = $value; |
173 | 173 | } elseif ( is_array( $this->field ) ) { |
174 | - $this->field[ $column ] = $value; |
|
174 | + $this->field[$column] = $value; |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | printf( |
638 | 638 | /* translators: %s: Field type */ |
639 | 639 | esc_html__( '%s Options', 'formidable' ), |
640 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
640 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
641 | 641 | ); |
642 | 642 | FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon frm_svg13', array( 'aria-hidden' => 'true' ) ); |
643 | 643 | ?> |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | * New field |
738 | 738 | */ |
739 | 739 | public function get_new_field_defaults() { |
740 | - $field = array( |
|
740 | + $field = array( |
|
741 | 741 | 'name' => $this->get_new_field_name(), |
742 | 742 | 'description' => '', |
743 | 743 | 'type' => $this->type, |
@@ -768,8 +768,8 @@ discard block |
||
768 | 768 | |
769 | 769 | $fields = array_merge( $fields, $pro_fields ); |
770 | 770 | |
771 | - if ( isset( $fields[ $this->type ] ) ) { |
|
772 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
771 | + if ( isset( $fields[$this->type] ) ) { |
|
772 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
773 | 773 | } |
774 | 774 | |
775 | 775 | return $name; |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | * @return array |
787 | 787 | */ |
788 | 788 | public function get_default_field_options() { |
789 | - $opts = array( |
|
789 | + $opts = array( |
|
790 | 790 | 'size' => '', |
791 | 791 | 'max' => '', |
792 | 792 | 'label' => '', |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | * @return void |
1031 | 1031 | */ |
1032 | 1032 | public function set_aria_invalid_error( &$shortcode_atts, $args ) { |
1033 | - $shortcode_atts['aria-invalid'] = isset( $args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false'; |
|
1033 | + $shortcode_atts['aria-invalid'] = isset( $args['errors']['field' . $this->field_id] ) ? 'true' : 'false'; |
|
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | /** |
@@ -1190,11 +1190,11 @@ discard block |
||
1190 | 1190 | } |
1191 | 1191 | |
1192 | 1192 | $options = array_values( $this->field['options'] ); |
1193 | - if ( ! isset( $options[ $opt ] ) ) { |
|
1193 | + if ( ! isset( $options[$opt] ) ) { |
|
1194 | 1194 | return $hidden; |
1195 | 1195 | } |
1196 | 1196 | |
1197 | - $option = $options[ $opt ]; |
|
1197 | + $option = $options[$opt]; |
|
1198 | 1198 | if ( is_array( $option ) ) { |
1199 | 1199 | $option = $option['value']; |
1200 | 1200 | } |
@@ -1258,8 +1258,8 @@ discard block |
||
1258 | 1258 | $selected = $values['field_value']; |
1259 | 1259 | |
1260 | 1260 | if ( isset( $values['combo_name'] ) ) { |
1261 | - $options = $options[ $values['combo_name'] ]; |
|
1262 | - $selected = is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ? $selected[ $values['combo_name'] ] : ''; |
|
1261 | + $options = $options[$values['combo_name']]; |
|
1262 | + $selected = is_array( $selected ) && isset( $selected[$values['combo_name']] ) ? $selected[$values['combo_name']] : ''; |
|
1263 | 1263 | } |
1264 | 1264 | |
1265 | 1265 | $input = $this->select_tag( $values ); |
@@ -1314,7 +1314,7 @@ discard block |
||
1314 | 1314 | } |
1315 | 1315 | |
1316 | 1316 | protected function fill_display_field_values( $args = array() ) { |
1317 | - $defaults = array( |
|
1317 | + $defaults = array( |
|
1318 | 1318 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
1319 | 1319 | 'field_id' => $this->get_field_column( 'id' ), |
1320 | 1320 | 'field_plus_id' => '', |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | } |
1372 | 1372 | } |
1373 | 1373 | |
1374 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
1374 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
1375 | 1375 | if ( $error_comes_first ) { |
1376 | 1376 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
1377 | 1377 | } else { |
@@ -1449,11 +1449,11 @@ discard block |
||
1449 | 1449 | |
1450 | 1450 | $field_id = $this->get_field_column( 'id' ); |
1451 | 1451 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
1452 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
1452 | + $frm_validated_unique_values[$field_id] = array(); |
|
1453 | 1453 | return false; |
1454 | 1454 | } |
1455 | 1455 | |
1456 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
1456 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
1457 | 1457 | return $already_validated_this_value; |
1458 | 1458 | } |
1459 | 1459 | |
@@ -1478,7 +1478,7 @@ discard block |
||
1478 | 1478 | private function value_validated_as_unique( $value ) { |
1479 | 1479 | global $frm_validated_unique_values; |
1480 | 1480 | $field_id = $this->get_field_column( 'id' ); |
1481 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
1481 | + $frm_validated_unique_values[$field_id][] = $value; |
|
1482 | 1482 | } |
1483 | 1483 | |
1484 | 1484 | /** |
@@ -1523,8 +1523,8 @@ discard block |
||
1523 | 1523 | $value = $this->prepare_display_value( $value, $atts ); |
1524 | 1524 | |
1525 | 1525 | if ( is_array( $value ) ) { |
1526 | - if ( ! empty( $atts['show'] ) && isset( $value[ $atts['show'] ] ) ) { |
|
1527 | - $value = $value[ $atts['show'] ]; |
|
1526 | + if ( ! empty( $atts['show'] ) && isset( $value[$atts['show']] ) ) { |
|
1527 | + $value = $value[$atts['show']]; |
|
1528 | 1528 | } elseif ( empty( $atts['return_array'] ) ) { |
1529 | 1529 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
1530 | 1530 | $value = FrmAppHelper::safe_implode( $sep, $value ); |
@@ -1654,8 +1654,8 @@ discard block |
||
1654 | 1654 | $saved_entries = $atts['ids']; |
1655 | 1655 | $new_value = array(); |
1656 | 1656 | foreach ( (array) $value as $old_child_id ) { |
1657 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
1658 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
1657 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
1658 | + $new_value[] = $saved_entries[$old_child_id]; |
|
1659 | 1659 | } |
1660 | 1660 | } |
1661 | 1661 |
@@ -197,7 +197,7 @@ |
||
197 | 197 | ); |
198 | 198 | |
199 | 199 | foreach ( $default_value_type['data'] as $data_key => $data_value ) { |
200 | - $toggle_args['input_html'][ 'data-' . $data_key ] = $data_value . ( substr( $data_value, -1 ) === '-' ? $field['id'] : '' ); |
|
200 | + $toggle_args['input_html']['data-' . $data_key] = $data_value . ( substr( $data_value, -1 ) === '-' ? $field['id'] : '' ); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | ?> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if ( in_array( $type, array( 'data', 'lookup' ), true ) ) { |
39 | 39 | $values['field_options']['data_type'] = $setting; |
40 | 40 | } else { |
41 | - $values['field_options'][ $setting ] = 1; |
|
41 | + $values['field_options'][$setting] = 1; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -172,10 +172,10 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | foreach ( $defaults as $opt => $default ) { |
175 | - $values[ $opt ] = isset( $field->field_options[ $opt ] ) ? $field->field_options[ $opt ] : $default; |
|
175 | + $values[$opt] = isset( $field->field_options[$opt] ) ? $field->field_options[$opt] : $default; |
|
176 | 176 | |
177 | 177 | if ( $check_post ) { |
178 | - self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] ); |
|
178 | + self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] ); |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | return self::$context_is_safe_to_load_field_options_from_request_data; |
193 | 193 | } |
194 | 194 | |
195 | - $function = function () { |
|
195 | + $function = function() { |
|
196 | 196 | if ( ! FrmAppHelper::is_admin_page() ) { |
197 | 197 | return false; |
198 | 198 | } |
@@ -300,12 +300,12 @@ discard block |
||
300 | 300 | * @param mixed $value |
301 | 301 | */ |
302 | 302 | private static function get_posted_field_setting( $setting, &$value ) { |
303 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
303 | + if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
304 | 304 | return; |
305 | 305 | } |
306 | 306 | |
307 | 307 | if ( strpos( $setting, 'html' ) !== false ) { |
308 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
308 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
309 | 309 | |
310 | 310 | // Conditionally strip script tags if the user sending $_POST data is not allowed to use unfiltered HTML. |
311 | 311 | if ( ! FrmAppHelper::allow_unfiltered_html() ) { |
@@ -313,9 +313,9 @@ discard block |
||
313 | 313 | } |
314 | 314 | } elseif ( strpos( $setting, 'format_' ) === 0 ) { |
315 | 315 | // TODO: Remove stripslashes on output, and use on input only. |
316 | - $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
316 | + $value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
317 | 317 | } else { |
318 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
318 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
319 | 319 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
320 | 320 | } |
321 | 321 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | $values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value ); |
389 | 389 | |
390 | 390 | foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) { |
391 | - $values[ $col ] = $field->{$col}; |
|
391 | + $values[$col] = $field->{$col}; |
|
392 | 392 | } |
393 | 393 | } |
394 | 394 | |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | ); |
427 | 427 | |
428 | 428 | $msg = FrmField::get_option( $field, $error ); |
429 | - $msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg; |
|
429 | + $msg = empty( $msg ) ? $defaults[$error]['part'] : $msg; |
|
430 | 430 | $msg = do_shortcode( $msg ); |
431 | 431 | |
432 | 432 | $msg = self::maybe_replace_substrings_with_field_name( $msg, $error, $field ); |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | 'inside_class' => 'inside', |
696 | 696 | 'close-icon' => true, |
697 | 697 | ); |
698 | - $args = array_merge( $defaults, $args ); |
|
698 | + $args = array_merge( $defaults, $args ); |
|
699 | 699 | |
700 | 700 | include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php'; |
701 | 701 | } |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | continue; |
934 | 934 | } |
935 | 935 | |
936 | - $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] ); |
|
936 | + $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] ); |
|
937 | 937 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
938 | 938 | |
939 | 939 | $atts['entry'] = $entry; |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | if ( $replace_with !== null ) { |
944 | 944 | $replace_with = self::trigger_shortcode_atts( $replace_with, $atts ); |
945 | 945 | self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with ); |
946 | - $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content ); |
|
946 | + $content = str_replace( $shortcodes[0][$short_key], $replace_with, $content ); |
|
947 | 947 | } |
948 | 948 | |
949 | 949 | unset( $atts, $replace_with ); |
@@ -961,7 +961,7 @@ discard block |
||
961 | 961 | $supported_atts = array( 'remove_accents', 'sanitize', 'sanitize_url' ); |
962 | 962 | $included_atts = array_intersect( $supported_atts, array_keys( $atts ) ); |
963 | 963 | foreach ( $included_atts as $included_att ) { |
964 | - if ( '0' === $atts[ $included_att ] ) { |
|
964 | + if ( '0' === $atts[$included_att] ) { |
|
965 | 965 | // Skip any option that uses 0 so sanitize_url=0 does not encode. |
966 | 966 | continue; |
967 | 967 | } |
@@ -1039,8 +1039,8 @@ discard block |
||
1039 | 1039 | |
1040 | 1040 | $dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get', 'default-email', 'default-from-email' ); |
1041 | 1041 | |
1042 | - if ( isset( $shortcode_values[ $atts['tag'] ] ) ) { |
|
1043 | - $replace_with = $shortcode_values[ $atts['tag'] ]; |
|
1042 | + if ( isset( $shortcode_values[$atts['tag']] ) ) { |
|
1043 | + $replace_with = $shortcode_values[$atts['tag']]; |
|
1044 | 1044 | } elseif ( in_array( $atts['tag'], $dynamic_default, true ) ) { |
1045 | 1045 | $replace_with = self::dynamic_default_values( $atts['tag'], $atts ); |
1046 | 1046 | } elseif ( $clean_tag === 'user_agent' ) { |
@@ -1264,8 +1264,8 @@ discard block |
||
1264 | 1264 | self::field_types_for_input( $single_input, $field_selection, $field_types ); |
1265 | 1265 | } elseif ( in_array( $type, $multiple_input, true ) ) { |
1266 | 1266 | self::field_types_for_input( $multiple_input, $field_selection, $field_types ); |
1267 | - } elseif ( isset( $field_selection[ $type ] ) ) { |
|
1268 | - $field_types[ $type ] = $field_selection[ $type ]; |
|
1267 | + } elseif ( isset( $field_selection[$type] ) ) { |
|
1268 | + $field_types[$type] = $field_selection[$type]; |
|
1269 | 1269 | } |
1270 | 1270 | |
1271 | 1271 | $field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) ); |
@@ -1307,7 +1307,7 @@ discard block |
||
1307 | 1307 | foreach ( $inputs as $input ) { |
1308 | 1308 | // This may not be set if a field type was removed using the frm_available_fields or frm_pro_available_fields filters. |
1309 | 1309 | if ( array_key_exists( $input, $fields ) ) { |
1310 | - $field_types[ $input ] = $fields[ $input ]; |
|
1310 | + $field_types[$input] = $fields[$input]; |
|
1311 | 1311 | } |
1312 | 1312 | unset( $input ); |
1313 | 1313 | } |
@@ -1340,7 +1340,7 @@ discard block |
||
1340 | 1340 | 'parent' => false, |
1341 | 1341 | 'pointer' => false, |
1342 | 1342 | ); |
1343 | - $args = wp_parse_args( $args, $defaults ); |
|
1343 | + $args = wp_parse_args( $args, $defaults ); |
|
1344 | 1344 | |
1345 | 1345 | $opt_key = $args['opt_key']; |
1346 | 1346 | $field = $args['field']; |
@@ -1356,25 +1356,25 @@ discard block |
||
1356 | 1356 | |
1357 | 1357 | // Check posted vals before checking saved values |
1358 | 1358 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
1359 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1359 | + if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1360 | 1360 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
1361 | 1361 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1362 | - $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 ] ) ) : ''; |
|
1362 | + $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] ) ) : ''; |
|
1363 | 1363 | } else { |
1364 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1364 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1365 | 1365 | } |
1366 | 1366 | |
1367 | 1367 | return $other_val; |
1368 | 1368 | } |
1369 | 1369 | |
1370 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1370 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1371 | 1371 | // For normal fields |
1372 | 1372 | |
1373 | 1373 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
1374 | 1374 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1375 | - $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
1375 | + $other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : ''; |
|
1376 | 1376 | } else { |
1377 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1377 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1378 | 1378 | } |
1379 | 1379 | |
1380 | 1380 | return $other_val; |
@@ -1384,8 +1384,8 @@ discard block |
||
1384 | 1384 | if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) { |
1385 | 1385 | // Check if there is an "other" val in saved value and make sure the |
1386 | 1386 | // "other" val is not equal to the Other checkbox option |
1387 | - if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) { |
|
1388 | - $other_val = $field['value'][ $opt_key ]; |
|
1387 | + if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) { |
|
1388 | + $other_val = $field['value'][$opt_key]; |
|
1389 | 1389 | } |
1390 | 1390 | } else { |
1391 | 1391 | /** |
@@ -1397,8 +1397,8 @@ discard block |
||
1397 | 1397 | // Multi-select dropdowns - key is not preserved |
1398 | 1398 | if ( is_array( $field['value'] ) ) { |
1399 | 1399 | $o_key = array_search( $temp_val, $field['value'] ); |
1400 | - if ( isset( $field['value'][ $o_key ] ) ) { |
|
1401 | - unset( $field['value'][ $o_key ], $o_key ); |
|
1400 | + if ( isset( $field['value'][$o_key] ) ) { |
|
1401 | + unset( $field['value'][$o_key], $o_key ); |
|
1402 | 1402 | } |
1403 | 1403 | } elseif ( $temp_val == $field['value'] ) { |
1404 | 1404 | // For radio and regular dropdowns |
@@ -1606,11 +1606,11 @@ discard block |
||
1606 | 1606 | foreach ( $val as $k => $v ) { |
1607 | 1607 | if ( is_string( $v ) ) { |
1608 | 1608 | if ( 'custom_html' === $k ) { |
1609 | - $val[ $k ] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
1609 | + $val[$k] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
1610 | 1610 | unset( $k, $v ); |
1611 | 1611 | continue; |
1612 | 1612 | } |
1613 | - $val[ $k ] = str_replace( $replace, $replace_with, $v ); |
|
1613 | + $val[$k] = str_replace( $replace, $replace_with, $v ); |
|
1614 | 1614 | unset( $k, $v ); |
1615 | 1615 | } |
1616 | 1616 | } |
@@ -1639,8 +1639,8 @@ discard block |
||
1639 | 1639 | if ( false === $index ) { |
1640 | 1640 | continue; |
1641 | 1641 | } |
1642 | - unset( $replace[ $index ] ); |
|
1643 | - unset( $replace_with[ $index ] ); |
|
1642 | + unset( $replace[$index] ); |
|
1643 | + unset( $replace_with[$index] ); |
|
1644 | 1644 | } |
1645 | 1645 | $value = str_replace( $replace, $replace_with, $value ); |
1646 | 1646 | return $value; |
@@ -1988,7 +1988,7 @@ discard block |
||
1988 | 1988 | $countries['class'] = 'frm-countries-opts'; |
1989 | 1989 | } |
1990 | 1990 | |
1991 | - $prepop[ __( 'Countries', 'formidable' ) ] = $countries; |
|
1991 | + $prepop[__( 'Countries', 'formidable' )] = $countries; |
|
1992 | 1992 | |
1993 | 1993 | // State abv. |
1994 | 1994 | $states = self::get_us_states(); |
@@ -1998,7 +1998,7 @@ discard block |
||
1998 | 1998 | $state_abv['class'] = 'frm-state-abv-opts'; |
1999 | 1999 | } |
2000 | 2000 | |
2001 | - $prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv; |
|
2001 | + $prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv; |
|
2002 | 2002 | |
2003 | 2003 | // States. |
2004 | 2004 | $states = array_values( $states ); |
@@ -2007,7 +2007,7 @@ discard block |
||
2007 | 2007 | $states['class'] = 'frm-states-opts'; |
2008 | 2008 | } |
2009 | 2009 | |
2010 | - $prepop[ __( 'U.S. States', 'formidable' ) ] = $states; |
|
2010 | + $prepop[__( 'U.S. States', 'formidable' )] = $states; |
|
2011 | 2011 | unset( $state_abv, $states ); |
2012 | 2012 | |
2013 | 2013 | // Age. |
@@ -2025,7 +2025,7 @@ discard block |
||
2025 | 2025 | $ages['class'] = 'frm-age-opts'; |
2026 | 2026 | } |
2027 | 2027 | |
2028 | - $prepop[ __( 'Age', 'formidable' ) ] = $ages; |
|
2028 | + $prepop[__( 'Age', 'formidable' )] = $ages; |
|
2029 | 2029 | |
2030 | 2030 | // Satisfaction. |
2031 | 2031 | $satisfaction = array( |
@@ -2040,7 +2040,7 @@ discard block |
||
2040 | 2040 | $satisfaction['class'] = 'frm-satisfaction-opts'; |
2041 | 2041 | } |
2042 | 2042 | |
2043 | - $prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction; |
|
2043 | + $prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction; |
|
2044 | 2044 | |
2045 | 2045 | // Importance. |
2046 | 2046 | $importance = array( |
@@ -2055,7 +2055,7 @@ discard block |
||
2055 | 2055 | $importance['class'] = 'frm-importance-opts'; |
2056 | 2056 | } |
2057 | 2057 | |
2058 | - $prepop[ __( 'Importance', 'formidable' ) ] = $importance; |
|
2058 | + $prepop[__( 'Importance', 'formidable' )] = $importance; |
|
2059 | 2059 | |
2060 | 2060 | // Agreement. |
2061 | 2061 | $agreement = array( |
@@ -2070,7 +2070,7 @@ discard block |
||
2070 | 2070 | $agreement['class'] = 'frm-agreement-opts'; |
2071 | 2071 | } |
2072 | 2072 | |
2073 | - $prepop[ __( 'Agreement', 'formidable' ) ] = $agreement; |
|
2073 | + $prepop[__( 'Agreement', 'formidable' )] = $agreement; |
|
2074 | 2074 | |
2075 | 2075 | // Likely. |
2076 | 2076 | $likely = array( |
@@ -2085,7 +2085,7 @@ discard block |
||
2085 | 2085 | $likely['class'] = 'frm-likely-opts'; |
2086 | 2086 | } |
2087 | 2087 | |
2088 | - $prepop[ __( 'Likely', 'formidable' ) ] = $likely; |
|
2088 | + $prepop[__( 'Likely', 'formidable' )] = $likely; |
|
2089 | 2089 | |
2090 | 2090 | $prepop = apply_filters( 'frm_bulk_field_choices', $prepop ); |
2091 | 2091 | } |
@@ -2306,16 +2306,16 @@ discard block |
||
2306 | 2306 | */ |
2307 | 2307 | private static function fill_image_setting_options( $options, &$args ) { |
2308 | 2308 | foreach ( $options as $key => $option ) { |
2309 | - $args['options'][ $key ] = $option; |
|
2309 | + $args['options'][$key] = $option; |
|
2310 | 2310 | |
2311 | 2311 | if ( ! empty( $option['addon'] ) ) { |
2312 | - $args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
2312 | + $args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
2313 | 2313 | } |
2314 | 2314 | |
2315 | - unset( $args['options'][ $key ]['addon'] ); |
|
2315 | + unset( $args['options'][$key]['addon'] ); |
|
2316 | 2316 | $fill = array( 'upgrade', 'message', 'content' ); |
2317 | 2317 | foreach ( $fill as $f ) { |
2318 | - unset( $args['options'][ $key ][ $f ], $f ); |
|
2318 | + unset( $args['options'][$key][$f], $f ); |
|
2319 | 2319 | } |
2320 | 2320 | } |
2321 | 2321 | } |
@@ -2336,8 +2336,8 @@ discard block |
||
2336 | 2336 | |
2337 | 2337 | $fill = array( 'upgrade', 'message', 'content' ); |
2338 | 2338 | foreach ( $fill as $f ) { |
2339 | - if ( isset( $option[ $f ] ) ) { |
|
2340 | - $custom_attrs[ 'data-' . $f ] = $option[ $f ]; |
|
2339 | + if ( isset( $option[$f] ) ) { |
|
2340 | + $custom_attrs['data-' . $f] = $option[$f]; |
|
2341 | 2341 | } |
2342 | 2342 | } |
2343 | 2343 | |
@@ -2403,7 +2403,7 @@ discard block |
||
2403 | 2403 | |
2404 | 2404 | return array_filter( |
2405 | 2405 | $rows, |
2406 | - function ( $row ) { |
|
2406 | + function( $row ) { |
|
2407 | 2407 | FrmAppHelper::unserialize_or_decode( $row->field_options ); |
2408 | 2408 | return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] ); |
2409 | 2409 | } |