@@ -78,7 +78,8 @@ |
||
78 | 78 | |
79 | 79 | if ( ! isset( $imported['form_status'] ) || empty( $imported['form_status'] ) ) { |
80 | 80 | // Check for an error message in the XML. |
81 | - if ( isset( $xml->Code ) && isset( $xml->Message ) ) { // phpcs:ignore WordPress.NamingConventions |
|
81 | + if ( isset( $xml->Code ) && isset( $xml->Message ) ) { |
|
82 | +// phpcs:ignore WordPress.NamingConventions |
|
82 | 83 | $imported['error'] = reset( $xml->Message ); // phpcs:ignore WordPress.NamingConventions |
83 | 84 | } |
84 | 85 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | if ( $term && is_array( $term ) ) { |
131 | 131 | $imported['imported']['terms'] ++; |
132 | - $imported['terms'][ (int) $t->term_id ] = $term['term_id']; |
|
132 | + $imported['terms'][(int) $t->term_id] = $term['term_id']; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | unset( $term, $t ); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | // Keep track of whether this specific form was updated or not. |
188 | - $imported['form_status'][ $form_id ] = 'imported'; |
|
188 | + $imported['form_status'][$form_id] = 'imported'; |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | // Update field ids/keys to new ones. |
201 | 201 | do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) ); |
202 | 202 | |
203 | - $imported['forms'][ (int) $item->id ] = $form_id; |
|
203 | + $imported['forms'][(int) $item->id] = $form_id; |
|
204 | 204 | |
205 | 205 | // Send pre 2.0 form options through function that creates actions. |
206 | 206 | self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true ); |
@@ -263,15 +263,15 @@ discard block |
||
263 | 263 | } |
264 | 264 | |
265 | 265 | // Keep track of whether this specific form was updated or not |
266 | - $imported['form_status'][ $form_id ] = 'updated'; |
|
266 | + $imported['form_status'][$form_id] = 'updated'; |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | private static function get_form_fields( $form_id ) { |
270 | 270 | $form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' ); |
271 | 271 | $old_fields = array(); |
272 | 272 | foreach ( $form_fields as $f ) { |
273 | - $old_fields[ $f->id ] = $f; |
|
274 | - $old_fields[ $f->field_key ] = $f->id; |
|
273 | + $old_fields[$f->id] = $f; |
|
274 | + $old_fields[$f->field_key] = $f->id; |
|
275 | 275 | unset( $f ); |
276 | 276 | } |
277 | 277 | $form_fields = $old_fields; |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | */ |
329 | 329 | private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) { |
330 | 330 | if ( $parent_form_id ) { |
331 | - $child_forms[ $form_id ] = $parent_form_id; |
|
331 | + $child_forms[$form_id] = $parent_form_id; |
|
332 | 332 | } |
333 | 333 | } |
334 | 334 | |
@@ -343,9 +343,9 @@ discard block |
||
343 | 343 | */ |
344 | 344 | private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) { |
345 | 345 | foreach ( $child_forms as $child_form_id => $old_parent_form_id ) { |
346 | - if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) { |
|
346 | + if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) { |
|
347 | 347 | // Update all children with this old parent_form_id |
348 | - $new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ]; |
|
348 | + $new_parent_form_id = (int) $imported_forms[$old_parent_form_id]; |
|
349 | 349 | FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) ); |
350 | 350 | do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id ); |
351 | 351 | } |
@@ -375,27 +375,27 @@ discard block |
||
375 | 375 | |
376 | 376 | if ( ! empty( $this_form ) ) { |
377 | 377 | // check for field to edit by field id |
378 | - if ( isset( $form_fields[ $f['id'] ] ) ) { |
|
378 | + if ( isset( $form_fields[$f['id']] ) ) { |
|
379 | 379 | FrmField::update( $f['id'], $f ); |
380 | 380 | $imported['updated']['fields'] ++; |
381 | 381 | |
382 | - unset( $form_fields[ $f['id'] ] ); |
|
382 | + unset( $form_fields[$f['id']] ); |
|
383 | 383 | |
384 | 384 | //unset old field key |
385 | - if ( isset( $form_fields[ $f['field_key'] ] ) ) { |
|
386 | - unset( $form_fields[ $f['field_key'] ] ); |
|
385 | + if ( isset( $form_fields[$f['field_key']] ) ) { |
|
386 | + unset( $form_fields[$f['field_key']] ); |
|
387 | 387 | } |
388 | - } elseif ( isset( $form_fields[ $f['field_key'] ] ) ) { |
|
389 | - $keys_by_original_field_id[ $f['id'] ] = $f['field_key']; |
|
388 | + } elseif ( isset( $form_fields[$f['field_key']] ) ) { |
|
389 | + $keys_by_original_field_id[$f['id']] = $f['field_key']; |
|
390 | 390 | |
391 | 391 | // check for field to edit by field key |
392 | 392 | unset( $f['id'] ); |
393 | 393 | |
394 | - FrmField::update( $form_fields[ $f['field_key'] ], $f ); |
|
394 | + FrmField::update( $form_fields[$f['field_key']], $f ); |
|
395 | 395 | $imported['updated']['fields'] ++; |
396 | 396 | |
397 | - unset( $form_fields[ $form_fields[ $f['field_key'] ] ] ); //unset old field id |
|
398 | - unset( $form_fields[ $f['field_key'] ] ); //unset old field key |
|
397 | + unset( $form_fields[$form_fields[$f['field_key']]] ); //unset old field id |
|
398 | + unset( $form_fields[$f['field_key']] ); //unset old field key |
|
399 | 399 | } else { |
400 | 400 | // if no matching field id or key in this form, create the field |
401 | 401 | self::create_imported_field( $f, $imported ); |
@@ -504,8 +504,8 @@ discard block |
||
504 | 504 | if ( $f['type'] == 'form' || ( $f['type'] == 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) { |
505 | 505 | if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) { |
506 | 506 | $form_select = (int) $f['field_options']['form_select']; |
507 | - if ( isset( $imported['forms'][ $form_select ] ) ) { |
|
508 | - $f['field_options']['form_select'] = $imported['forms'][ $form_select ]; |
|
507 | + if ( isset( $imported['forms'][$form_select] ) ) { |
|
508 | + $f['field_options']['form_select'] = $imported['forms'][$form_select]; |
|
509 | 509 | } |
510 | 510 | } |
511 | 511 | } |
@@ -526,8 +526,8 @@ discard block |
||
526 | 526 | |
527 | 527 | if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) { |
528 | 528 | $old_form = $f['field_options']['get_values_form']; |
529 | - if ( isset( $imported['forms'][ $old_form ] ) ) { |
|
530 | - $f['field_options']['get_values_form'] = $imported['forms'][ $old_form ]; |
|
529 | + if ( isset( $imported['forms'][$old_form] ) ) { |
|
530 | + $f['field_options']['get_values_form'] = $imported['forms'][$old_form]; |
|
531 | 531 | } |
532 | 532 | } |
533 | 533 | } |
@@ -548,12 +548,12 @@ discard block |
||
548 | 548 | private static function migrate_placeholders( &$f ) { |
549 | 549 | $update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' ); |
550 | 550 | foreach ( $update_values as $k => $v ) { |
551 | - $f[ $k ] = $v; |
|
551 | + $f[$k] = $v; |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | $update_values = self::migrate_field_placeholder( $f, 'default_blank' ); |
555 | 555 | foreach ( $update_values as $k => $v ) { |
556 | - $f[ $k ] = $v; |
|
556 | + $f[$k] = $v; |
|
557 | 557 | } |
558 | 558 | } |
559 | 559 | |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | public static function migrate_field_placeholder( $field, $type ) { |
568 | 568 | $field = (array) $field; |
569 | 569 | $field_options = $field['field_options']; |
570 | - if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) { |
|
570 | + if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) { |
|
571 | 571 | return array(); |
572 | 572 | } |
573 | 573 | |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | } |
594 | 594 | |
595 | 595 | if ( $opt == $default_value ) { |
596 | - unset( $options[ $opt_key ] ); |
|
596 | + unset( $options[$opt_key] ); |
|
597 | 597 | break; |
598 | 598 | } |
599 | 599 | } |
@@ -790,17 +790,17 @@ discard block |
||
790 | 790 | self::update_layout( $post, $post_id ); |
791 | 791 | |
792 | 792 | $this_type = 'posts'; |
793 | - if ( isset( $post_types[ $post['post_type'] ] ) ) { |
|
794 | - $this_type = $post_types[ $post['post_type'] ]; |
|
793 | + if ( isset( $post_types[$post['post_type']] ) ) { |
|
794 | + $this_type = $post_types[$post['post_type']]; |
|
795 | 795 | } |
796 | 796 | |
797 | 797 | if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) { |
798 | - $imported['updated'][ $this_type ] ++; |
|
798 | + $imported['updated'][$this_type] ++; |
|
799 | 799 | } else { |
800 | - $imported['imported'][ $this_type ] ++; |
|
800 | + $imported['imported'][$this_type] ++; |
|
801 | 801 | } |
802 | 802 | |
803 | - $imported['posts'][ (int) $old_id ] = $post_id; |
|
803 | + $imported['posts'][(int) $old_id] = $post_id; |
|
804 | 804 | |
805 | 805 | do_action( 'frm_after_import_view', $post_id, $post ); |
806 | 806 | |
@@ -817,9 +817,9 @@ discard block |
||
817 | 817 | $post['attachment_url'] = (string) $item->attachment_url; |
818 | 818 | } |
819 | 819 | |
820 | - if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) { |
|
820 | + if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) { |
|
821 | 821 | // update to new form id |
822 | - $post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ]; |
|
822 | + $post['menu_order'] = $imported['forms'][(int) $post['menu_order']]; |
|
823 | 823 | } |
824 | 824 | |
825 | 825 | // Don't allow default styles to take over a site's default style |
@@ -851,8 +851,8 @@ discard block |
||
851 | 851 | ); |
852 | 852 | |
853 | 853 | //switch old form and field ids to new ones |
854 | - if ( $m['key'] == 'frm_form_id' && isset( $imported['forms'][ (int) $m['value'] ] ) ) { |
|
855 | - $m['value'] = $imported['forms'][ (int) $m['value'] ]; |
|
854 | + if ( $m['key'] == 'frm_form_id' && isset( $imported['forms'][(int) $m['value']] ) ) { |
|
855 | + $m['value'] = $imported['forms'][(int) $m['value']]; |
|
856 | 856 | } else { |
857 | 857 | $m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] ); |
858 | 858 | |
@@ -863,15 +863,15 @@ discard block |
||
863 | 863 | } elseif ( $m['key'] == 'frm_options' ) { |
864 | 864 | |
865 | 865 | foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) { |
866 | - if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) { |
|
867 | - $m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ]; |
|
866 | + if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) { |
|
867 | + $m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]]; |
|
868 | 868 | } |
869 | 869 | } |
870 | 870 | |
871 | 871 | $check_dup_array = array(); |
872 | 872 | if ( isset( $m['value']['order_by'] ) && ! empty( $m['value']['order_by'] ) ) { |
873 | - if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) { |
|
874 | - $m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ]; |
|
873 | + if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) { |
|
874 | + $m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']]; |
|
875 | 875 | } elseif ( is_array( $m['value']['order_by'] ) ) { |
876 | 876 | $check_dup_array[] = 'order_by'; |
877 | 877 | } |
@@ -882,9 +882,9 @@ discard block |
||
882 | 882 | } |
883 | 883 | |
884 | 884 | foreach ( $check_dup_array as $check_k ) { |
885 | - foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) { |
|
886 | - if ( isset( $frm_duplicate_ids[ $mv ] ) ) { |
|
887 | - $m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ]; |
|
885 | + foreach ( (array) $m['value'][$check_k] as $mk => $mv ) { |
|
886 | + if ( isset( $frm_duplicate_ids[$mv] ) ) { |
|
887 | + $m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv]; |
|
888 | 888 | } |
889 | 889 | unset( $mk, $mv ); |
890 | 890 | } |
@@ -897,11 +897,11 @@ discard block |
||
897 | 897 | $m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] ); |
898 | 898 | } |
899 | 899 | |
900 | - $post['postmeta'][ (string) $meta->meta_key ] = $m['value']; |
|
900 | + $post['postmeta'][(string) $meta->meta_key] = $m['value']; |
|
901 | 901 | } |
902 | 902 | |
903 | 903 | private static function populate_layout( &$post, $layout ) { |
904 | - $post['layout'][ (string) $layout->type ] = (string) $layout->data; |
|
904 | + $post['layout'][(string) $layout->type] = (string) $layout->data; |
|
905 | 905 | } |
906 | 906 | |
907 | 907 | /** |
@@ -929,11 +929,11 @@ discard block |
||
929 | 929 | $name = (string) $c; |
930 | 930 | } |
931 | 931 | |
932 | - if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) { |
|
933 | - $post['tax_input'][ $taxonomy ] = array(); |
|
932 | + if ( ! isset( $post['tax_input'][$taxonomy] ) ) { |
|
933 | + $post['tax_input'][$taxonomy] = array(); |
|
934 | 934 | } |
935 | 935 | |
936 | - $post['tax_input'][ $taxonomy ][] = $name; |
|
936 | + $post['tax_input'][$taxonomy][] = $name; |
|
937 | 937 | unset( $name ); |
938 | 938 | } |
939 | 939 | } |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | |
1047 | 1047 | $message = '<ul>'; |
1048 | 1048 | foreach ( $result as $type => $results ) { |
1049 | - if ( ! isset( $t_strings[ $type ] ) ) { |
|
1049 | + if ( ! isset( $t_strings[$type] ) ) { |
|
1050 | 1050 | // only print imported and updated |
1051 | 1051 | continue; |
1052 | 1052 | } |
@@ -1058,7 +1058,7 @@ discard block |
||
1058 | 1058 | } |
1059 | 1059 | |
1060 | 1060 | if ( ! empty( $s_message ) ) { |
1061 | - $message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> '; |
|
1061 | + $message .= '<li><strong>' . $t_strings[$type] . ':</strong> '; |
|
1062 | 1062 | $message .= implode( ', ', $s_message ); |
1063 | 1063 | $message .= '</li>'; |
1064 | 1064 | } |
@@ -1098,7 +1098,7 @@ discard block |
||
1098 | 1098 | 'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ), |
1099 | 1099 | ); |
1100 | 1100 | |
1101 | - $s_message[] = isset( $strings[ $type ] ) ? $strings[ $type ] : ' ' . $m . ' ' . ucfirst( $type ); |
|
1101 | + $s_message[] = isset( $strings[$type] ) ? $strings[$type] : ' ' . $m . ' ' . ucfirst( $type ); |
|
1102 | 1102 | } |
1103 | 1103 | |
1104 | 1104 | /** |
@@ -1228,8 +1228,8 @@ discard block |
||
1228 | 1228 | */ |
1229 | 1229 | private static function remove_defaults( $defaults, &$saved ) { |
1230 | 1230 | foreach ( $saved as $key => $value ) { |
1231 | - if ( isset( $defaults[ $key ] ) && $defaults[ $key ] === $value ) { |
|
1232 | - unset( $saved[ $key ] ); |
|
1231 | + if ( isset( $defaults[$key] ) && $defaults[$key] === $value ) { |
|
1232 | + unset( $saved[$key] ); |
|
1233 | 1233 | } |
1234 | 1234 | } |
1235 | 1235 | } |
@@ -1240,14 +1240,14 @@ discard block |
||
1240 | 1240 | * @since 3.06 |
1241 | 1241 | */ |
1242 | 1242 | private static function remove_default_html( $html_name, $defaults, &$options ) { |
1243 | - if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) { |
|
1243 | + if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) { |
|
1244 | 1244 | return; |
1245 | 1245 | } |
1246 | 1246 | |
1247 | - $old_html = str_replace( "\r\n", "\n", $options[ $html_name ] ); |
|
1248 | - $default_html = $defaults[ $html_name ]; |
|
1247 | + $old_html = str_replace( "\r\n", "\n", $options[$html_name] ); |
|
1248 | + $default_html = $defaults[$html_name]; |
|
1249 | 1249 | if ( $old_html == $default_html ) { |
1250 | - unset( $options[ $html_name ] ); |
|
1250 | + unset( $options[$html_name] ); |
|
1251 | 1251 | |
1252 | 1252 | return; |
1253 | 1253 | } |
@@ -1255,7 +1255,7 @@ discard block |
||
1255 | 1255 | // Account for some of the older field default HTML. |
1256 | 1256 | $default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html ); |
1257 | 1257 | if ( $old_html == $default_html ) { |
1258 | - unset( $options[ $html_name ] ); |
|
1258 | + unset( $options[$html_name] ); |
|
1259 | 1259 | } |
1260 | 1260 | } |
1261 | 1261 | |
@@ -1346,8 +1346,8 @@ discard block |
||
1346 | 1346 | ); |
1347 | 1347 | |
1348 | 1348 | foreach ( $post_settings as $post_setting ) { |
1349 | - if ( isset( $form_options[ $post_setting ] ) ) { |
|
1350 | - $new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ]; |
|
1349 | + if ( isset( $form_options[$post_setting] ) ) { |
|
1350 | + $new_action['post_content'][$post_setting] = $form_options[$post_setting]; |
|
1351 | 1351 | } |
1352 | 1352 | unset( $post_setting ); |
1353 | 1353 | } |
@@ -1418,11 +1418,11 @@ discard block |
||
1418 | 1418 | foreach ( $post_content as $key => $setting ) { |
1419 | 1419 | if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) { |
1420 | 1420 | // Replace old IDs with new IDs |
1421 | - $post_content[ $key ] = str_replace( $old, $new, $setting ); |
|
1421 | + $post_content[$key] = str_replace( $old, $new, $setting ); |
|
1422 | 1422 | } elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) { |
1423 | 1423 | foreach ( $setting as $k => $val ) { |
1424 | 1424 | // Replace old IDs with new IDs |
1425 | - $post_content[ $key ][ $k ] = str_replace( $old, $new, $val ); |
|
1425 | + $post_content[$key][$k] = str_replace( $old, $new, $val ); |
|
1426 | 1426 | } |
1427 | 1427 | } |
1428 | 1428 | unset( $key, $setting ); |
@@ -1498,8 +1498,8 @@ discard block |
||
1498 | 1498 | private static function remove_deprecated_notification_settings( $form_id, $form_options ) { |
1499 | 1499 | $delete_settings = array( 'notification', 'autoresponder', 'email_to' ); |
1500 | 1500 | foreach ( $delete_settings as $index ) { |
1501 | - if ( isset( $form_options[ $index ] ) ) { |
|
1502 | - unset( $form_options[ $index ] ); |
|
1501 | + if ( isset( $form_options[$index] ) ) { |
|
1502 | + unset( $form_options[$index] ); |
|
1503 | 1503 | } |
1504 | 1504 | } |
1505 | 1505 | FrmForm::update( $form_id, array( 'options' => $form_options ) ); |
@@ -1552,12 +1552,12 @@ discard block |
||
1552 | 1552 | 'reply_to_name' => '', |
1553 | 1553 | ); |
1554 | 1554 | foreach ( $reply_fields as $f => $val ) { |
1555 | - if ( isset( $notification[ $f ] ) ) { |
|
1556 | - $atts[ $f ] = $notification[ $f ]; |
|
1557 | - if ( 'custom' == $notification[ $f ] ) { |
|
1558 | - $atts[ $f ] = $notification[ 'cust_' . $f ]; |
|
1559 | - } elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) { |
|
1560 | - $atts[ $f ] = '[' . $atts[ $f ] . ']'; |
|
1555 | + if ( isset( $notification[$f] ) ) { |
|
1556 | + $atts[$f] = $notification[$f]; |
|
1557 | + if ( 'custom' == $notification[$f] ) { |
|
1558 | + $atts[$f] = $notification['cust_' . $f]; |
|
1559 | + } elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) { |
|
1560 | + $atts[$f] = '[' . $atts[$f] . ']'; |
|
1561 | 1561 | } |
1562 | 1562 | } |
1563 | 1563 | unset( $f, $val ); |
@@ -1588,13 +1588,13 @@ discard block |
||
1588 | 1588 | foreach ( $atts['email_to'] as $key => $email_field ) { |
1589 | 1589 | |
1590 | 1590 | if ( is_numeric( $email_field ) ) { |
1591 | - $atts['email_to'][ $key ] = '[' . $email_field . ']'; |
|
1591 | + $atts['email_to'][$key] = '[' . $email_field . ']'; |
|
1592 | 1592 | } |
1593 | 1593 | |
1594 | 1594 | if ( strpos( $email_field, '|' ) ) { |
1595 | 1595 | $email_opt = explode( '|', $email_field ); |
1596 | 1596 | if ( isset( $email_opt[0] ) ) { |
1597 | - $atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']'; |
|
1597 | + $atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']'; |
|
1598 | 1598 | } |
1599 | 1599 | unset( $email_opt ); |
1600 | 1600 | } |
@@ -1615,12 +1615,12 @@ discard block |
||
1615 | 1615 | // Add more fields to the new notification |
1616 | 1616 | $add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' ); |
1617 | 1617 | foreach ( $add_fields as $add_field ) { |
1618 | - if ( isset( $notification[ $add_field ] ) ) { |
|
1619 | - $new_notification['post_content'][ $add_field ] = $notification[ $add_field ]; |
|
1618 | + if ( isset( $notification[$add_field] ) ) { |
|
1619 | + $new_notification['post_content'][$add_field] = $notification[$add_field]; |
|
1620 | 1620 | } elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) { |
1621 | - $new_notification['post_content'][ $add_field ] = 0; |
|
1621 | + $new_notification['post_content'][$add_field] = 0; |
|
1622 | 1622 | } else { |
1623 | - $new_notification['post_content'][ $add_field ] = ''; |
|
1623 | + $new_notification['post_content'][$add_field] = ''; |
|
1624 | 1624 | } |
1625 | 1625 | unset( $add_field ); |
1626 | 1626 | } |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) { |
1645 | 1645 | foreach ( $post_content['conditions'] as $email_key => $val ) { |
1646 | 1646 | if ( is_numeric( $email_key ) ) { |
1647 | - $post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) ); |
|
1647 | + $post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) ); |
|
1648 | 1648 | } |
1649 | 1649 | unset( $email_key, $val ); |
1650 | 1650 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | $info['url'] = $xml; |
7 | 7 | } |
8 | 8 | |
9 | - $disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : ''; |
|
9 | + $disabled = isset( $imported[$info['form']] ) ? ' disabled' : ''; |
|
10 | 10 | $url = isset( $info['url'] ) ? $info['url'] : ''; |
11 | 11 | $value = $importing === 'form' ? $info['form'] : $info['key']; |
12 | 12 | if ( ! isset( $info['img'] ) ) { |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | continue; |
17 | 17 | } |
18 | 18 | |
19 | - $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) ); |
|
19 | + $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) ); |
|
20 | 20 | ?> |
21 | 21 | <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' : '' ); ?>"> |
22 | 22 | <?php if ( $importing === 'form' ) { ?> |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | <?php } ?> |
37 | 37 | /> |
38 | 38 | <div class="frm_image_option_container frm_label_with_image"> |
39 | - <?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // WPCS: XSS ok. ?> |
|
39 | + <?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // WPCS: XSS ok. ?> |
|
40 | 40 | <span class="frm_text_label_for_image"> |
41 | 41 | <?php |
42 | 42 | if ( ! empty( $disabled ) ) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | if ( $importing === 'form' && $disabled ) { |
52 | - echo FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ); // WPCS: XSS ok. |
|
52 | + echo FrmFormsHelper::edit_form_link( $imported[$info['form']] ); // WPCS: XSS ok. |
|
53 | 53 | } else { |
54 | 54 | echo esc_html( $info['name'] ); |
55 | 55 | } |
@@ -144,11 +144,11 @@ |
||
144 | 144 | if ( isset( $response['success'] ) && ! $response['success'] ) { |
145 | 145 | // What happens when the CAPTCHA was entered incorrectly |
146 | 146 | $invalid_message = FrmField::get_option( $this->field, 'invalid' ); |
147 | - $errors[ 'field' . $args['id'] ] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message ); |
|
147 | + $errors['field' . $args['id']] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message ); |
|
148 | 148 | } elseif ( is_wp_error( $resp ) ) { |
149 | 149 | $error_string = $resp->get_error_message(); |
150 | - $errors[ 'field' . $args['id'] ] = __( 'There was a problem verifying your recaptcha', 'formidable' ); |
|
151 | - $errors[ 'field' . $args['id'] ] .= ' ' . $error_string; |
|
150 | + $errors['field' . $args['id']] = __( 'There was a problem verifying your recaptcha', 'formidable' ); |
|
151 | + $errors['field' . $args['id']] .= ' ' . $error_string; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | return $errors; |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | * @param array $atts |
42 | 42 | */ |
43 | 43 | private function _set( $param, $atts ) { |
44 | - if ( isset( $atts[ $param ] ) ) { |
|
45 | - $this->{$param} = $atts[ $param ]; |
|
44 | + if ( isset( $atts[$param] ) ) { |
|
45 | + $this->{$param} = $atts[$param]; |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | |
87 | 87 | $exclude = array( 'field_obj', 'html' ); |
88 | 88 | foreach ( $exclude as $ex ) { |
89 | - if ( isset( $atts[ $ex ] ) ) { |
|
90 | - unset( $this->pass_args[ $ex ] ); |
|
89 | + if ( isset( $atts[$ex] ) ) { |
|
90 | + unset( $this->pass_args[$ex] ); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | } |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | * @param array $set |
100 | 100 | */ |
101 | 101 | private function set_from_field( $atts, $set ) { |
102 | - if ( isset( $atts[ $set['param'] ] ) ) { |
|
103 | - $this->{$set['param']} = $atts[ $set['param'] ]; |
|
102 | + if ( isset( $atts[$set['param']] ) ) { |
|
103 | + $this->{$set['param']} = $atts[$set['param']]; |
|
104 | 104 | } else { |
105 | 105 | $this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] ); |
106 | 106 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | private function replace_error_shortcode() { |
227 | 227 | $this->maybe_add_error_id(); |
228 | - $error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false; |
|
228 | + $error = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? $this->pass_args['errors']['field' . $this->field_id] : false; |
|
229 | 229 | FrmShortcodeHelper::remove_inline_conditions( ! empty( $error ), 'error', $error, $this->html ); |
230 | 230 | } |
231 | 231 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | * @since 3.06.02 |
237 | 237 | */ |
238 | 238 | private function maybe_add_error_id() { |
239 | - if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
239 | + if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
240 | 240 | return; |
241 | 241 | } |
242 | 242 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER ); |
317 | 317 | |
318 | 318 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
319 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
319 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
320 | 320 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
321 | 321 | |
322 | 322 | $replace_with = ''; |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $replace_with = $this->replace_input_shortcode( $shortcode_atts ); |
328 | 328 | } |
329 | 329 | |
330 | - $this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html ); |
|
330 | + $this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html ); |
|
331 | 331 | } |
332 | 332 | } |
333 | 333 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | unset( $shortcode_atts['class'] ); |
360 | 360 | } |
361 | 361 | |
362 | - $shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false'; |
|
362 | + $shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? 'true' : 'false'; |
|
363 | 363 | |
364 | 364 | $this->field_obj->set_field_column( 'shortcodes', $shortcode_atts ); |
365 | 365 | |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | */ |
415 | 415 | private function get_field_div_classes() { |
416 | 416 | // Add error class |
417 | - $classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : ''; |
|
417 | + $classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : ''; |
|
418 | 418 | |
419 | 419 | // Add label position class |
420 | 420 | $settings = $this->field_obj->display_field_settings(); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | return; |
122 | 122 | } |
123 | 123 | |
124 | - $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : ''; |
|
124 | + $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : ''; |
|
125 | 125 | if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) { |
126 | 126 | return; |
127 | 127 | } |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | * @since 4.06.02 |
134 | 134 | */ |
135 | 135 | private static function get_selected_in_form( $form, $value = 'form' ) { |
136 | - if ( ! empty( $form ) && isset( $form[ $value ] ) && ! empty( $form[ $value ] ) ) { |
|
137 | - return $form[ $value ]; |
|
136 | + if ( ! empty( $form ) && isset( $form[$value] ) && ! empty( $form[$value] ) ) { |
|
137 | + return $form[$value]; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | return ''; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | if ( $for === 'view' ) { |
166 | - $item_key = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys; |
|
166 | + $item_key = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys; |
|
167 | 167 | $shortcode = '[display-frm-data id=%1$s filter=limited]'; |
168 | 168 | } elseif ( $for === 'form' ) { |
169 | 169 | $item_key = $form_key; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | continue; |
179 | 179 | } |
180 | 180 | |
181 | - $page_ids[ $for ] = wp_insert_post( |
|
181 | + $page_ids[$for] = wp_insert_post( |
|
182 | 182 | array( |
183 | 183 | 'post_title' => $name, |
184 | 184 | 'post_type' => 'page', |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash |
320 | 320 | $file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] ); |
321 | 321 | $file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) ); |
322 | - if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) { |
|
322 | + if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) { |
|
323 | 323 | // allow other file types to be imported |
324 | 324 | do_action( 'frm_before_import_' . $file_type ); |
325 | 325 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | foreach ( $type as $tb_type ) { |
403 | 403 | $where = array(); |
404 | 404 | $join = ''; |
405 | - $table = $tables[ $tb_type ]; |
|
405 | + $table = $tables[$tb_type]; |
|
406 | 406 | |
407 | 407 | $select = $table . '.id'; |
408 | 408 | $query_vars = array(); |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | $table . '.parent_form_id' => $args['ids'], |
418 | 418 | ); |
419 | 419 | } else { |
420 | - $where[ $table . '.status !' ] = 'draft'; |
|
420 | + $where[$table . '.status !'] = 'draft'; |
|
421 | 421 | } |
422 | 422 | break; |
423 | 423 | case 'actions': |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | case 'items': |
431 | 431 | // $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)"; |
432 | 432 | if ( $args['ids'] ) { |
433 | - $where[ $table . '.form_id' ] = $args['ids']; |
|
433 | + $where[$table . '.form_id'] = $args['ids']; |
|
434 | 434 | } |
435 | 435 | break; |
436 | 436 | case 'styles': |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | } |
472 | 472 | } |
473 | 473 | |
474 | - $records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select ); |
|
474 | + $records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select ); |
|
475 | 475 | unset( $tb_type ); |
476 | 476 | } |
477 | 477 | |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | $no_export_fields = FrmField::no_save_fields(); |
617 | 617 | foreach ( $csv_fields as $k => $f ) { |
618 | 618 | if ( in_array( $f->type, $no_export_fields, true ) ) { |
619 | - unset( $csv_fields[ $k ] ); |
|
619 | + unset( $csv_fields[$k] ); |
|
620 | 620 | } |
621 | 621 | } |
622 | 622 |
@@ -9,6 +9,6 @@ |
||
9 | 9 | $type = $field['type']; |
10 | 10 | do_action( 'frm_after_checkbox', compact( 'field', 'field_name', 'type' ) ); |
11 | 11 | } else { |
12 | - $read_only = $field['read_only']; |
|
12 | + $read_only = $field['read_only']; |
|
13 | 13 | include dirname( __FILE__ ) . '/' . $field['type'] . '-field.php'; |
14 | 14 | } |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | </li><?php |
17 | 17 | $render_icon = true; |
18 | 18 | foreach ( array( 20872734, 20874748, 20882522, 20874739 ) as $template ) { |
19 | - if ( isset( $templates[ $template ] ) ) { |
|
20 | - $template = $templates[ $template ]; |
|
19 | + if ( isset( $templates[$template] ) ) { |
|
20 | + $template = $templates[$template]; |
|
21 | 21 | require $view_path . 'list-template.php'; |
22 | 22 | } |
23 | 23 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | <ul class="frm-templates-list frm-categories-list"> |
46 | 46 | <?php foreach ( $categories as $category ) { ?> |
47 | 47 | <?php |
48 | - $category_templates = $templates_by_category[ $category ]; |
|
48 | + $category_templates = $templates_by_category[$category]; |
|
49 | 49 | $count = count( $category_templates ); |
50 | 50 | $available = FrmFormsHelper::available_count( $category_templates, $args ); |
51 | 51 | ?> |
@@ -283,7 +283,7 @@ |
||
283 | 283 | 'content' => 'upgrade', |
284 | 284 | ) |
285 | 285 | ); |
286 | - $renew_link = FrmAppHelper::admin_upgrade_link( |
|
286 | + $renew_link = FrmAppHelper::admin_upgrade_link( |
|
287 | 287 | array( |
288 | 288 | 'medium' => 'new-template', |
289 | 289 | 'content' => 'renew', |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | $field_val = ''; |
133 | 133 | if ( is_object( $this->field ) ) { |
134 | 134 | $field_val = $this->field->{$column}; |
135 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
136 | - $field_val = $this->field[ $column ]; |
|
135 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
136 | + $field_val = $this->field[$column]; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $field_val; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | if ( is_object( $this->field ) ) { |
148 | 148 | $this->field->{$column} = $value; |
149 | 149 | } elseif ( is_array( $this->field ) ) { |
150 | - $this->field[ $column ] = $value; |
|
150 | + $this->field[$column] = $value; |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | printf( |
470 | 470 | /* translators: %s: Field type */ |
471 | 471 | esc_html__( '%s Options', 'formidable' ), |
472 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
472 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
473 | 473 | ); |
474 | 474 | ?> |
475 | 475 | <i class="frm_icon_font frm_arrowdown6_icon"></i> |
@@ -592,8 +592,8 @@ discard block |
||
592 | 592 | $fields = FrmField::field_selection(); |
593 | 593 | $fields = array_merge( $fields, FrmField::pro_field_selection() ); |
594 | 594 | |
595 | - if ( isset( $fields[ $this->type ] ) ) { |
|
596 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
595 | + if ( isset( $fields[$this->type] ) ) { |
|
596 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
597 | 597 | } |
598 | 598 | |
599 | 599 | return $name; |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | } |
605 | 605 | |
606 | 606 | public function get_default_field_options() { |
607 | - $opts = array( |
|
607 | + $opts = array( |
|
608 | 608 | 'size' => '', |
609 | 609 | 'max' => '', |
610 | 610 | 'label' => '', |
@@ -942,7 +942,7 @@ discard block |
||
942 | 942 | } |
943 | 943 | } else { |
944 | 944 | $args['save_array'] = $this->is_readonly_array(); |
945 | - $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
945 | + $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
946 | 946 | } |
947 | 947 | |
948 | 948 | return $hidden; |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | protected function show_single_hidden( $selected, $args ) { |
952 | 952 | if ( $args['save_array'] ) { |
953 | 953 | $args['field_name'] .= '[]'; |
954 | - $id = ''; |
|
954 | + $id = ''; |
|
955 | 955 | } else { |
956 | 956 | $id = ' id="' . esc_attr( $args['html_id'] ) . '"'; |
957 | 957 | } |
@@ -967,8 +967,8 @@ discard block |
||
967 | 967 | $selected = $values['field_value']; |
968 | 968 | |
969 | 969 | if ( isset( $values['combo_name'] ) ) { |
970 | - $options = $options[ $values['combo_name'] ]; |
|
971 | - $selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : ''; |
|
970 | + $options = $options[$values['combo_name']]; |
|
971 | + $selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : ''; |
|
972 | 972 | } |
973 | 973 | |
974 | 974 | $input = $this->select_tag( $values ); |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | } |
1020 | 1020 | |
1021 | 1021 | protected function fill_display_field_values( $args = array() ) { |
1022 | - $defaults = array( |
|
1022 | + $defaults = array( |
|
1023 | 1023 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
1024 | 1024 | 'field_id' => $this->get_field_column( 'id' ), |
1025 | 1025 | 'field_plus_id' => '', |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | $describedby = 'frm_desc_' . $args['html_id']; |
1058 | 1058 | } |
1059 | 1059 | |
1060 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) ) { |
|
1060 | + if ( isset( $args['errors']['field' . $args['field_id']] ) ) { |
|
1061 | 1061 | $describedby .= ' frm_error_' . $args['html_id']; |
1062 | 1062 | } |
1063 | 1063 | |
@@ -1116,11 +1116,11 @@ discard block |
||
1116 | 1116 | |
1117 | 1117 | $field_id = $this->get_field_column( 'id' ); |
1118 | 1118 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
1119 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
1119 | + $frm_validated_unique_values[$field_id] = array(); |
|
1120 | 1120 | return false; |
1121 | 1121 | } |
1122 | 1122 | |
1123 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
1123 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
1124 | 1124 | return $already_validated_this_value; |
1125 | 1125 | } |
1126 | 1126 | |
@@ -1145,7 +1145,7 @@ discard block |
||
1145 | 1145 | private function value_validated_as_unique( $value ) { |
1146 | 1146 | global $frm_validated_unique_values; |
1147 | 1147 | $field_id = $this->get_field_column( 'id' ); |
1148 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
1148 | + $frm_validated_unique_values[$field_id][] = $value; |
|
1149 | 1149 | } |
1150 | 1150 | |
1151 | 1151 | public function get_value_to_save( $value, $atts ) { |
@@ -1177,8 +1177,8 @@ discard block |
||
1177 | 1177 | $value = $this->prepare_display_value( $value, $atts ); |
1178 | 1178 | |
1179 | 1179 | if ( is_array( $value ) ) { |
1180 | - if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) { |
|
1181 | - $value = $value[ $atts['show'] ]; |
|
1180 | + if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) { |
|
1181 | + $value = $value[$atts['show']]; |
|
1182 | 1182 | } elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) { |
1183 | 1183 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
1184 | 1184 | $value = implode( $sep, $value ); |
@@ -1247,8 +1247,8 @@ discard block |
||
1247 | 1247 | $saved_entries = $atts['ids']; |
1248 | 1248 | $new_value = array(); |
1249 | 1249 | foreach ( (array) $value as $old_child_id ) { |
1250 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
1251 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
1250 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
1251 | + $new_value[] = $saved_entries[$old_child_id]; |
|
1252 | 1252 | } |
1253 | 1253 | } |
1254 | 1254 |