@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | $groups = FrmFormActionsController::form_action_groups(); |
209 | 209 | $group = 'misc'; |
210 | 210 | |
211 | - if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) { |
|
211 | + if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) { |
|
212 | 212 | $group = $action_options['group']; |
213 | - } elseif ( isset( $groups[ $this->id_base ] ) ) { |
|
213 | + } elseif ( isset( $groups[$this->id_base] ) ) { |
|
214 | 214 | $group = $this->id_base; |
215 | 215 | } else { |
216 | 216 | foreach ( $groups as $name => $check_group ) { |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
224 | - $groups[ $group ]['id'] = $group; |
|
225 | - return $groups[ $group ]; |
|
224 | + $groups[$group]['id'] = $group; |
|
225 | + return $groups[$group]; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @return int $post_id |
334 | 334 | */ |
335 | 335 | public function maybe_create_action( $action, $forms ) { |
336 | - if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] === 'updated' ) { |
|
336 | + if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] === 'updated' ) { |
|
337 | 337 | // Update action only |
338 | 338 | $action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] ); |
339 | 339 | $post_id = $this->save_settings( $action ); |
@@ -356,18 +356,18 @@ discard block |
||
356 | 356 | $switch = $this->get_global_switch_fields(); |
357 | 357 | |
358 | 358 | foreach ( (array) $action->post_content as $key => $val ) { |
359 | - if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) { |
|
360 | - $action->post_content[ $key ] = $frm_duplicate_ids[ $val ]; |
|
359 | + if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) { |
|
360 | + $action->post_content[$key] = $frm_duplicate_ids[$val]; |
|
361 | 361 | } elseif ( ! is_array( $val ) ) { |
362 | - $action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val ); |
|
363 | - } elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) { |
|
362 | + $action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val ); |
|
363 | + } elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) { |
|
364 | 364 | // loop through each value if empty |
365 | - if ( empty( $switch[ $key ] ) ) { |
|
366 | - $switch[ $key ] = array_keys( $val ); |
|
365 | + if ( empty( $switch[$key] ) ) { |
|
366 | + $switch[$key] = array_keys( $val ); |
|
367 | 367 | } |
368 | 368 | |
369 | - foreach ( $switch[ $key ] as $subkey ) { |
|
370 | - $action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val ); |
|
369 | + foreach ( $switch[$key] as $subkey ) { |
|
370 | + $action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val ); |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | |
@@ -385,20 +385,20 @@ discard block |
||
385 | 385 | foreach ( $subkey as $subkey2 ) { |
386 | 386 | foreach ( (array) $val as $ck => $cv ) { |
387 | 387 | if ( is_array( $cv ) ) { |
388 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv ); |
|
389 | - } elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) { |
|
390 | - $action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ]; |
|
388 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv ); |
|
389 | + } elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) { |
|
390 | + $action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]]; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | } |
394 | 394 | } else { |
395 | 395 | foreach ( (array) $val as $ck => $cv ) { |
396 | 396 | if ( is_array( $cv ) ) { |
397 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv ); |
|
398 | - } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) { |
|
399 | - $action[ $ck ] = $frm_duplicate_ids[ $cv ]; |
|
397 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv ); |
|
398 | + } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) { |
|
399 | + $action[$ck] = $frm_duplicate_ids[$cv]; |
|
400 | 400 | } elseif ( $ck == $subkey ) { |
401 | - $action[ $ck ] = $this->maybe_switch_field_ids( $action[ $ck ] ); |
|
401 | + $action[$ck] = $this->maybe_switch_field_ids( $action[$ck] ); |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 | }//end if |
@@ -422,10 +422,10 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
425 | - if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) { |
|
425 | + if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) { |
|
426 | 426 | // Sanitizing removes scripts and <email> type of values. |
427 | 427 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
428 | - $settings = wp_unslash( $_POST[ $this->option_name ] ); |
|
428 | + $settings = wp_unslash( $_POST[$this->option_name] ); |
|
429 | 429 | } else { |
430 | 430 | return; |
431 | 431 | } |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | foreach ( $settings as $number => $new_instance ) { |
436 | 436 | $this->_set( $number ); |
437 | 437 | |
438 | - $old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array(); |
|
438 | + $old_instance = isset( $all_instances[$number] ) ? $all_instances[$number] : array(); |
|
439 | 439 | |
440 | 440 | if ( ! isset( $new_instance['post_status'] ) ) { |
441 | 441 | $new_instance['post_status'] = 'draft'; |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $instance['post_content'], $instance, $new_instance, $old_instance, $this ); |
475 | 475 | |
476 | 476 | if ( false !== $instance ) { |
477 | - $all_instances[ $number ] = $instance; |
|
477 | + $all_instances[$number] = $instance; |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | $action_ids[] = $this->save_settings( $instance ); |
@@ -560,12 +560,12 @@ discard block |
||
560 | 560 | // some plugins/themes are formatting the post_excerpt |
561 | 561 | $action->post_excerpt = sanitize_title( $action->post_excerpt ); |
562 | 562 | |
563 | - if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) { |
|
563 | + if ( ! isset( $action_controls[$action->post_excerpt] ) ) { |
|
564 | 564 | continue; |
565 | 565 | } |
566 | 566 | |
567 | - $action = $action_controls[ $action->post_excerpt ]->prepare_action( $action ); |
|
568 | - $settings[ $action->ID ] = $action; |
|
567 | + $action = $action_controls[$action->post_excerpt]->prepare_action( $action ); |
|
568 | + $settings[$action->ID] = $action; |
|
569 | 569 | |
570 | 570 | if ( count( $settings ) >= $limit ) { |
571 | 571 | break; |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | * @return int The filtered limit value. |
592 | 592 | */ |
593 | 593 | public static function get_action_limit( $form_id, $limit = 99 ) { |
594 | - $type = 'all'; |
|
594 | + $type = 'all'; |
|
595 | 595 | return (int) apply_filters( 'frm_form_action_limit', (int) $limit, compact( 'type', 'form_id' ) ); |
596 | 596 | } |
597 | 597 | |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | 'limit' => 99, |
615 | 615 | 'post_status' => $default_status, |
616 | 616 | ); |
617 | - $args = wp_parse_args( $args, $defaults ); |
|
617 | + $args = wp_parse_args( $args, $defaults ); |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | /** |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | |
685 | 685 | $action = $this->prepare_action( $action ); |
686 | 686 | |
687 | - $settings[ $action->ID ] = $action; |
|
687 | + $settings[$action->ID] = $action; |
|
688 | 688 | } |
689 | 689 | |
690 | 690 | if ( 1 === $limit ) { |
@@ -727,10 +727,10 @@ discard block |
||
727 | 727 | |
728 | 728 | foreach ( $default_values as $k => $vals ) { |
729 | 729 | if ( is_array( $vals ) && ! empty( $vals ) ) { |
730 | - if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) { |
|
730 | + if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) { |
|
731 | 731 | continue; |
732 | 732 | } |
733 | - $action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals ); |
|
733 | + $action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals ); |
|
734 | 734 | } |
735 | 735 | } |
736 | 736 | |
@@ -818,9 +818,9 @@ discard block |
||
818 | 818 | |
819 | 819 | // fill with existing options |
820 | 820 | foreach ( $action->post_content as $name => $val ) { |
821 | - if ( isset( $form->options[ $name ] ) ) { |
|
822 | - $action->post_content[ $name ] = $form->options[ $name ]; |
|
823 | - unset( $form->options[ $name ] ); |
|
821 | + if ( isset( $form->options[$name] ) ) { |
|
822 | + $action->post_content[$name] = $form->options[$name]; |
|
823 | + unset( $form->options[$name] ); |
|
824 | 824 | } |
825 | 825 | } |
826 | 826 | |
@@ -906,8 +906,8 @@ discard block |
||
906 | 906 | private static function get_value_from_entry( $entry, $field_id ) { |
907 | 907 | $observed_value = ''; |
908 | 908 | |
909 | - if ( isset( $entry->metas[ $field_id ] ) ) { |
|
910 | - $observed_value = $entry->metas[ $field_id ]; |
|
909 | + if ( isset( $entry->metas[$field_id] ) ) { |
|
910 | + $observed_value = $entry->metas[$field_id]; |
|
911 | 911 | } elseif ( $entry->post_id && FrmAppHelper::pro_is_installed() ) { |
912 | 912 | $field = FrmField::getOne( $field_id ); |
913 | 913 | $observed_value = FrmProEntryMetaHelper::get_post_or_meta_value( |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | $form_fields = FrmField::get_all_for_form( $form_id, '', 'include' ); |
982 | 982 | return array_filter( |
983 | 983 | $form_fields, |
984 | - function ( $form_field ) { |
|
984 | + function( $form_field ) { |
|
985 | 985 | return ! FrmField::is_no_save_field( $form_field->type ); |
986 | 986 | } |
987 | 987 | ); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $info['url'] = $xml; |
12 | 12 | } |
13 | 13 | |
14 | - $disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : ''; |
|
14 | + $disabled = isset( $imported[$info['form']] ) ? ' disabled' : ''; |
|
15 | 15 | $url = isset( $info['url'] ) ? $info['url'] : ''; |
16 | 16 | $value = $importing === 'form' ? $info['form'] : $info['key']; |
17 | 17 | if ( ! isset( $info['img'] ) ) { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | continue; |
22 | 22 | } |
23 | 23 | |
24 | - $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) ); |
|
24 | + $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) ); |
|
25 | 25 | ?> |
26 | 26 | <div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>"> |
27 | 27 | <?php if ( $importing === 'form' ) { ?> |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | if ( $importing === 'form' && $disabled ) { |
57 | - FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) ); |
|
57 | + FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) ); |
|
58 | 58 | } else { |
59 | 59 | echo esc_html( $info['name'] ); |
60 | 60 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | ); |
127 | 127 | |
128 | 128 | foreach ( $skipped_keys as $skipped_key ) { |
129 | - unset( $data[ $skipped_key ] ); |
|
129 | + unset( $data[$skipped_key] ); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | return $data; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | |
225 | 225 | foreach ( $pass_settings as $setting ) { |
226 | 226 | if ( isset( $settings_list->$setting ) ) { |
227 | - $settings[ $setting ] = $this->maybe_json( $settings_list->$setting ); |
|
227 | + $settings[$setting] = $this->maybe_json( $settings_list->$setting ); |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | $message_settings = array(); |
262 | 262 | foreach ( $messages as $message ) { |
263 | - $message_settings[ 'changed-' . $message ] = $settings_list->$message === $default[ $message ] ? 0 : 1; |
|
263 | + $message_settings['changed-' . $message] = $settings_list->$message === $default[$message] ? 0 : 1; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | return $message_settings; |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
282 | 282 | if ( isset( $settings_list->$frm_role ) ) { |
283 | - $permissions[ $frm_role ] = $settings_list->$frm_role; |
|
283 | + $permissions[$frm_role] = $settings_list->$frm_role; |
|
284 | 284 | } |
285 | 285 | } |
286 | 286 | |
@@ -351,9 +351,9 @@ discard block |
||
351 | 351 | ); |
352 | 352 | |
353 | 353 | foreach ( $settings as $setting ) { |
354 | - if ( isset( $form->options[ $setting ] ) ) { |
|
354 | + if ( isset( $form->options[$setting] ) ) { |
|
355 | 355 | if ( 'custom_style' === $setting ) { |
356 | - $style->id = $form->options[ $setting ]; |
|
356 | + $style->id = $form->options[$setting]; |
|
357 | 357 | |
358 | 358 | if ( ! $style->id ) { |
359 | 359 | $style_name = 0; |
@@ -364,9 +364,9 @@ discard block |
||
364 | 364 | $style_name = $style_post ? $style_post->post_name : 'formidable-style'; |
365 | 365 | } |
366 | 366 | |
367 | - $new_form[ $setting ] = $style_name; |
|
367 | + $new_form[$setting] = $style_name; |
|
368 | 368 | } else { |
369 | - $new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] ); |
|
369 | + $new_form[$setting] = $this->maybe_json( $form->options[$setting] ); |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $fields = FrmDb::get_results( 'frm_fields', array(), 'id, form_id, name, type, field_options', $args ); |
427 | 427 | foreach ( $fields as $k => $field ) { |
428 | 428 | FrmAppHelper::unserialize_or_decode( $field->field_options ); |
429 | - $fields[ $k ]->field_options = json_encode( $field->field_options ); |
|
429 | + $fields[$k]->field_options = json_encode( $field->field_options ); |
|
430 | 430 | } |
431 | 431 | return $fields; |
432 | 432 | } |
@@ -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 | /** |
@@ -1219,8 +1219,8 @@ discard block |
||
1219 | 1219 | $selected = $values['field_value']; |
1220 | 1220 | |
1221 | 1221 | if ( isset( $values['combo_name'] ) ) { |
1222 | - $options = $options[ $values['combo_name'] ]; |
|
1223 | - $selected = is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ? $selected[ $values['combo_name'] ] : ''; |
|
1222 | + $options = $options[$values['combo_name']]; |
|
1223 | + $selected = is_array( $selected ) && isset( $selected[$values['combo_name']] ) ? $selected[$values['combo_name']] : ''; |
|
1224 | 1224 | } |
1225 | 1225 | |
1226 | 1226 | $input = $this->select_tag( $values ); |
@@ -1275,7 +1275,7 @@ discard block |
||
1275 | 1275 | } |
1276 | 1276 | |
1277 | 1277 | protected function fill_display_field_values( $args = array() ) { |
1278 | - $defaults = array( |
|
1278 | + $defaults = array( |
|
1279 | 1279 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
1280 | 1280 | 'field_id' => $this->get_field_column( 'id' ), |
1281 | 1281 | 'field_plus_id' => '', |
@@ -1332,7 +1332,7 @@ discard block |
||
1332 | 1332 | } |
1333 | 1333 | } |
1334 | 1334 | |
1335 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
1335 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
1336 | 1336 | if ( $error_comes_first ) { |
1337 | 1337 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
1338 | 1338 | } else { |
@@ -1411,11 +1411,11 @@ discard block |
||
1411 | 1411 | |
1412 | 1412 | $field_id = $this->get_field_column( 'id' ); |
1413 | 1413 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
1414 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
1414 | + $frm_validated_unique_values[$field_id] = array(); |
|
1415 | 1415 | return false; |
1416 | 1416 | } |
1417 | 1417 | |
1418 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
1418 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
1419 | 1419 | return $already_validated_this_value; |
1420 | 1420 | } |
1421 | 1421 | |
@@ -1440,7 +1440,7 @@ discard block |
||
1440 | 1440 | private function value_validated_as_unique( $value ) { |
1441 | 1441 | global $frm_validated_unique_values; |
1442 | 1442 | $field_id = $this->get_field_column( 'id' ); |
1443 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
1443 | + $frm_validated_unique_values[$field_id][] = $value; |
|
1444 | 1444 | } |
1445 | 1445 | |
1446 | 1446 | /** |
@@ -1485,8 +1485,8 @@ discard block |
||
1485 | 1485 | $value = $this->prepare_display_value( $value, $atts ); |
1486 | 1486 | |
1487 | 1487 | if ( is_array( $value ) ) { |
1488 | - if ( ! empty( $atts['show'] ) && isset( $value[ $atts['show'] ] ) ) { |
|
1489 | - $value = $value[ $atts['show'] ]; |
|
1488 | + if ( ! empty( $atts['show'] ) && isset( $value[$atts['show']] ) ) { |
|
1489 | + $value = $value[$atts['show']]; |
|
1490 | 1490 | } elseif ( empty( $atts['return_array'] ) ) { |
1491 | 1491 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
1492 | 1492 | $value = FrmAppHelper::safe_implode( $sep, $value ); |
@@ -1616,8 +1616,8 @@ discard block |
||
1616 | 1616 | $saved_entries = $atts['ids']; |
1617 | 1617 | $new_value = array(); |
1618 | 1618 | foreach ( (array) $value as $old_child_id ) { |
1619 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
1620 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
1619 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
1620 | + $new_value[] = $saved_entries[$old_child_id]; |
|
1621 | 1621 | } |
1622 | 1622 | } |
1623 | 1623 |