PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.23
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.23
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/FrmForm.php +162 -51 6.46.23 View file →
@@ -6,9 +6,9 @@
6 6 class FrmForm {
7 7
8 8 /**
9 9 * @param array $values
10 - * @return int|bool id on success or false on failure.
10 + * @return bool|int id on success or false on failure.
11 11 */
12 12 public static function create( $values ) {
13 13 global $wpdb;
14 14
@@ -69,9 +69,9 @@
69 69 return FrmAppHelper::maybe_filter_array( $options, array( 'submit_value', 'success_msg', 'before_html', 'after_html' ) );
70 70 }
71 71
72 72 /**
73 - * @return int|boolean ID on success or false on failure
73 + * @return bool|int ID on success or false on failure
74 74 */
75 75 public static function duplicate( $id, $template = false, $copy_keys = false, $blog_id = false ) {
76 76 global $wpdb;
77 77
@@ -93,10 +93,10 @@
93 93 'is_template' => $template ? 1 : 0,
94 94 );
95 95
96 96 if ( $blog_id ) {
97 - $new_values['status'] = 'published';
98 - $new_options = $values->options;
97 + $new_values['status'] = 'published';
98 + $new_options = $values->options;
99 99 FrmAppHelper::unserialize_or_decode( $new_options );
100 100 $new_options['email_to'] = get_option( 'admin_email' );
101 101 $new_options['copy'] = false;
102 102 $new_values['options'] = $new_options;
@@ -126,9 +126,9 @@
126 126 return false;
127 127 }
128 128
129 129 public static function after_duplicate( $form_id, $values ) {
130 - $new_opts = $values['options'];
130 + $new_opts = $values['options'];
131 131 FrmAppHelper::unserialize_or_decode( $new_opts );
132 132 $values['options'] = $new_opts;
133 133
134 134 if ( isset( $new_opts['success_msg'] ) ) {
@@ -158,9 +158,9 @@
158 158 // Keys of fields that you want to check to replace field ID.
159 159 $keys = array( 'default_value', 'field_options' );
160 160 $sql_cols = 'fi.id';
161 161 foreach ( $keys as $key ) {
162 - $sql_cols .= ( ',fi.' . $key );
162 + $sql_cols .= ',fi.' . $key;
163 163 }
164 164
165 165 $fields = FrmDb::get_results(
166 166 "{$wpdb->prefix}frm_fields AS fi LEFT OUTER JOIN {$wpdb->prefix}frm_forms AS fr ON fi.form_id = fr.id",
@@ -210,9 +210,9 @@
210 210
211 211 if ( $new_val !== $value ) {
212 212 $new_values[ $key ] = $new_val;
213 213 }
214 - }
214 + }//end foreach
215 215
216 216 if ( ! empty( $new_values ) ) {
217 217 FrmField::update( $field['id'], $new_values );
218 218 }
@@ -218,9 +218,9 @@
218 218 }
219 219 }
220 220
221 221 /**
222 - * @return int|boolean
222 + * @return bool|int
223 223 */
224 224 public static function update( $id, $values, $create_link = false ) {
225 225 global $wpdb;
226 226
@@ -243,9 +243,9 @@
243 243 $new_values[ $value_key ] = $value;
244 244 }
245 245 }
246 246
247 - if ( isset( $values['new_status'] ) && ! empty( $values['new_status'] ) ) {
247 + if ( ! empty( $values['new_status'] ) ) {
248 248 $new_values['status'] = $values['new_status'];
249 249 }
250 250
251 251 if ( ! empty( $new_values ) ) {
@@ -276,15 +276,15 @@
276 276 if ( ! isset( $values['options'] ) ) {
277 277 return $new_values;
278 278 }
279 279
280 - $options = isset( $values['options'] ) ? (array) $values['options'] : array();
280 + $options = ! empty( $values['options'] ) ? (array) $values['options'] : array();
281 281 FrmFormsHelper::fill_form_options( $options, $values );
282 282
283 283 $options['custom_style'] = isset( $values['options']['custom_style'] ) ? $values['options']['custom_style'] : 0;
284 284 $options['before_html'] = isset( $values['options']['before_html'] ) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html( 'before' );
285 285 $options['after_html'] = isset( $values['options']['after_html'] ) ? $values['options']['after_html'] : FrmFormsHelper::get_default_html( 'after' );
286 - $options['submit_html'] = ( isset( $values['options']['submit_html'] ) && '' !== $values['options']['submit_html'] ) ? $values['options']['submit_html'] : FrmFormsHelper::get_default_html( 'submit' );
286 + $options['submit_html'] = isset( $values['options']['submit_html'] ) && '' !== $values['options']['submit_html'] ? $values['options']['submit_html'] : FrmFormsHelper::get_default_html( 'submit' );
287 287
288 288 /**
289 289 * Allows modifying form options before updating or creating.
290 290 *
@@ -348,11 +348,12 @@
348 348 continue;
349 349 }
350 350 }
351 351
352 - //updating the form
352 + // Updating the form.
353 353 $update_options = FrmFieldsHelper::get_default_field_options_from_field( $field );
354 - unset( $update_options['custom_html'] ); // don't check for POST html
354 + // Don't check for POST html.
355 + unset( $update_options['custom_html'] );
355 356 $update_options = apply_filters( 'frm_field_options_to_update', $update_options );
356 357
357 358 foreach ( $update_options as $opt => $default ) {
358 359 $field->field_options[ $opt ] = isset( $values['field_options'][ $opt . '_' . $field_id ] ) ? $values['field_options'][ $opt . '_' . $field_id ] : $default;
@@ -376,13 +377,14 @@
376 377 }
377 378 }
378 379
379 380 self::prepare_field_update_values( $field, $values, $new_field );
381 + self::maybe_update_max_option( $field, $values, $new_field );
380 382
381 383 FrmField::update( $field_id, $new_field );
382 384
383 385 FrmField::delete_form_transient( $field->form_id );
384 - }
386 + }//end foreach
385 387 self::clear_form_cache();
386 388
387 389 return $values;
388 390 }
@@ -387,8 +389,33 @@
387 389 return $values;
388 390 }
389 391
390 392 /**
393 + * Resets the 'max' option of a field when changing paragraph field type to other field types like text, email etc.
394 + *
395 + * @since 6.7
396 + *
397 + * @param array $field
398 + * @param array $values
399 + * @param array $new_field
400 + * @return void
401 + */
402 + private static function maybe_update_max_option( $field, $values, &$new_field ) {
403 + if ( $field->type === 'textarea' &&
404 + ! empty( $values['field_options'][ 'type_' . $field->id ] ) &&
405 + in_array( $values['field_options'][ 'type_' . $field->id ], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) {
406 +
407 + $new_field['field_options']['max'] = '';
408 +
409 + /**
410 + * Update posted field setting so that new 'max' option is displayed after form is saved and page reloads.
411 + * FrmFieldsHelper::fill_default_field_opts populates field options by calling self::get_posted_field_setting.
412 + */
413 + $_POST['field_options'][ 'max_' . $field->id ] = '';
414 + }
415 + }
416 +
417 + /**
391 418 * @param string $opt
392 419 * @param mixed $value
393 420 * @return void
394 421 */
@@ -428,9 +455,10 @@
428 455 private static function sanitize_calc( $value ) {
429 456 if ( false !== strpos( $value, '<' ) ) {
430 457 $value = self::normalize_calc_spaces( $value );
431 458 }
432 - $allow = array( '<= ', ' >=' ); // Allow <= and >=
459 + // Allow <= and >=.
460 + $allow = array( '<= ', ' >=' );
433 461 $temp = array( '< = ', ' > =' );
434 462 $value = str_replace( $allow, $temp, $value );
435 463 $value = strip_tags( $value );
436 464 $value = str_replace( $temp, $allow, $value );
@@ -445,14 +473,16 @@
445 473 * @return string
446 474 */
447 475 private static function normalize_calc_spaces( $calc ) {
448 476 // Check for a pattern with 5 parts
449 - // $1 \d the first comparison digit.
477 + // $1 \d|\] the first comparison digit or the end of a comparison shortcode.
450 478 // $2 a space (optional).
451 479 // $3 an equals sign (optional) that follows the < operator for <= comparisons.
452 480 // $4 another space (optional).
453 - // $5 \d the second comparison digit.
454 - return preg_replace( '/(\d)( ){0,1}<(=){0,1}( ){0,1}(\d)/', '$1 <$3 $5', $calc );
481 + // $5 \d|\[ the second comparison digit or the start of a comparison shortcode.
482 + $calc = preg_replace( '/(\d|\])( ){0,1}<(=){0,1}( ){0,1}(\d|\[)/', '$1 <$3 $5', $calc );
483 +
484 + return $calc;
455 485 }
456 486
457 487 /**
458 488 * Updating the settings page
@@ -462,9 +492,9 @@
462 492 $prev_opts = array();
463 493 $fallback_html = isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type );
464 494
465 495 $field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ? $values['field_options'][ 'custom_html_' . $field->id ] : $fallback_html;
466 - } elseif ( $field->type == 'hidden' || $field->type == 'user_id' ) {
496 + } elseif ( $field->type === 'hidden' || $field->type === 'user_id' ) {
467 497 $prev_opts = $field->field_options;
468 498 }
469 499
470 500 if ( isset( $prev_opts ) ) {
@@ -485,11 +515,14 @@
485 515 'options' => '',
486 516 'name' => '',
487 517 );
488 518 foreach ( $field_cols as $col => $default ) {
489 - $default = ( $default === '' ) ? $field->{$col} : $default;
519 + $default = $default === '' ? $field->{$col} : $default;
520 + $new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default;
521 + }
490 522
491 - $new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default;
523 + if ( $field->type === 'submit' && isset( $new_field['field_order'] ) && (int) $new_field['field_order'] === FrmSubmitHelper::DEFAULT_ORDER ) {
524 + $new_field['field_order'] = $field->field_order;
492 525 }
493 526
494 527 // Don't save the template option.
495 528 if ( is_array( $new_field['options'] ) && isset( $new_field['options']['000'] ) ) {
@@ -501,9 +534,9 @@
501 534 * Get a list of all form settings that should be translated
502 535 * on a multilingual site.
503 536 *
504 537 * @since 3.06.01
505 - * @param object $form - The form object
538 + * @param object $form The form object.
506 539 */
507 540 public static function translatable_strings( $form ) {
508 541 $strings = array(
509 542 'name',
@@ -520,11 +553,12 @@
520 553 return apply_filters( 'frm_form_strings', $strings, $form );
521 554 }
522 555
523 556 /**
557 + * @param int $id
524 558 * @param string $status
525 559 *
526 - * @return int|boolean
560 + * @return bool|int
527 561 */
528 562 public static function set_status( $id, $status ) {
529 563 if ( 'trash' == $status ) {
530 564 return self::trash( $id );
@@ -530,9 +564,9 @@
530 564 return self::trash( $id );
531 565 }
532 566
533 567 $statuses = array( 'published', 'draft', 'trash' );
534 - if ( ! in_array( $status, $statuses ) ) {
568 + if ( ! in_array( $status, $statuses, true ) ) {
535 569 return false;
536 570 }
537 571
538 572 global $wpdb;
@@ -559,9 +593,9 @@
559 593 return $query_results;
560 594 }
561 595
562 596 /**
563 - * @return int|boolean
597 + * @return bool|int
564 598 */
565 599 public static function trash( $id ) {
566 600 if ( ! EMPTY_TRASH_DAYS ) {
567 601 return self::destroy( $id );
@@ -571,8 +605,12 @@
571 605 if ( ! $form ) {
572 606 return false;
573 607 }
574 608
609 + if ( $form->status === 'trash' ) {
610 + return false;
611 + }
612 +
575 613 $options = $form->options;
576 614 $options['trash_time'] = time();
577 615
578 616 global $wpdb;
@@ -605,9 +643,9 @@
605 643 return $query_results;
606 644 }
607 645
608 646 /**
609 - * @return int|boolean
647 + * @return bool|int
610 648 */
611 649 public static function destroy( $id ) {
612 650 global $wpdb;
613 651
@@ -629,8 +667,11 @@
629 667
630 668 $query_results = $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_forms WHERE id=%d OR parent_form_id=%d', $id, $id ) );
631 669 if ( $query_results ) {
632 670 // Delete all form actions linked to this form
671 + /**
672 + * @var FrmFormAction
673 + */
633 674 $action_control = FrmFormActionsController::get_form_actions( 'email' );
634 675 $action_control->destroy( $id, 'all' );
635 676
636 677 // Clear form caching
@@ -650,9 +691,9 @@
650 691 */
651 692 public static function scheduled_delete( $delete_timestamp = '' ) {
652 693 global $wpdb;
653 694
654 - $trash_forms = FrmDb::get_results( $wpdb->prefix . 'frm_forms', array( 'status' => 'trash' ), 'id, options' );
695 + $trash_forms = FrmDb::get_results( $wpdb->prefix . 'frm_forms', array( 'status' => 'trash' ), 'id, parent_form_id, options' );
655 696
656 697 if ( ! $trash_forms ) {
657 698 return 0;
658 699 }
@@ -665,9 +706,11 @@
665 706 foreach ( $trash_forms as $form ) {
666 707 FrmAppHelper::unserialize_or_decode( $form->options );
667 708 if ( ! isset( $form->options['trash_time'] ) || $form->options['trash_time'] < $delete_timestamp ) {
668 709 self::destroy( $form->id );
669 - $count ++;
710 + if ( empty( $form->parent_form_id ) ) {
711 + ++$count;
712 + }
670 713 }
671 714
672 715 unset( $form );
673 716 }
@@ -727,11 +770,10 @@
727 770
728 771 /**
729 772 * If $form is numeric, get the form object
730 773 *
731 - * @param object|int $form
732 - *
733 774 * @since 2.0.9
775 + * @param int|object $form
734 776 */
735 777 public static function maybe_get_form( &$form ) {
736 778 if ( ! is_object( $form ) && ! is_array( $form ) && ! empty( $form ) ) {
737 779 $form = self::getOne( $form );
@@ -738,9 +780,11 @@
738 780 }
739 781 }
740 782
741 783 /**
742 - * @return object form
784 + * @param int|string $id
785 + * @param false|int $blog_id
786 + * @return stdClass|null
743 787 */
744 788 public static function getOne( $id, $blog_id = false ) {
745 789 global $wpdb;
746 790
@@ -755,10 +799,9 @@
755 799 if ( $cache ) {
756 800 if ( isset( $cache->options ) ) {
757 801 FrmAppHelper::unserialize_or_decode( $cache->options );
758 802 }
759 -
760 - return apply_filters( 'frm_form_object', wp_unslash( $cache ) );
803 + return self::prepare_form_row_data( $cache );
761 804 }
762 805 }
763 806
764 807 if ( is_numeric( $id ) ) {
@@ -773,17 +816,43 @@
773 816 FrmDb::set_cache( $results->id, $results, 'frm_form' );
774 817 FrmAppHelper::unserialize_or_decode( $results->options );
775 818 }
776 819
777 - return apply_filters( 'frm_form_object', wp_unslash( $results ) );
820 + return self::prepare_form_row_data( $results );
778 821 }
779 822
780 823 /**
781 - * @return object|array of objects
824 + * Make sure that if $row is an object, that $row->options is an array and not a string.
825 + *
826 + * @since 6.8.3
827 + *
828 + * @param stdClass|null $row The database row for a target form.
829 + * @return stdClass|null
782 830 */
831 + private static function prepare_form_row_data( $row ) {
832 + $row = wp_unslash( $row );
833 + if ( ! is_object( $row ) ) {
834 + return $row;
835 + }
836 +
837 + if ( ! is_array( $row->options ) ) {
838 + $row->options = FrmFormsHelper::get_default_opts();
839 + }
840 +
841 + /**
842 + * @since 4.03.02
843 + *
844 + * @param stdClass $row
845 + */
846 + return apply_filters( 'frm_form_object', $row );
847 + }
848 +
849 + /**
850 + * @return array|object of objects
851 + */
783 852 public static function getAll( $where = array(), $order_by = '', $limit = '' ) {
784 853 if ( is_array( $where ) && ! empty( $where ) ) {
785 - if ( isset( $where['is_template'] ) && $where['is_template'] && ! isset( $where['status'] ) && ! isset( $where['status !'] ) ) {
854 + if ( ! empty( $where['is_template'] ) && ! isset( $where['status'] ) && ! isset( $where['status !'] ) ) {
786 855 // don't get trashed templates
787 856 $where['status'] = array( null, '', 'published' );
788 857 }
789 858
@@ -790,9 +859,9 @@
790 859 $results = FrmDb::get_results( 'frm_forms', $where, '*', compact( 'order_by', 'limit' ) );
791 860 } else {
792 861 global $wpdb;
793 862
794 - // the query has already been prepared if this is not an array
863 + // The query has already been prepared if this is not an array.
795 864 $query = 'SELECT * FROM ' . $wpdb->prefix . 'frm_forms' . FrmDb::prepend_and_or_where( ' WHERE ', $where ) . FrmDb::esc_order( $order_by ) . FrmDb::esc_limit( $limit );
796 865 $results = $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
797 866 }
798 867
@@ -802,9 +871,9 @@
802 871 FrmAppHelper::unserialize_or_decode( $result->options );
803 872 }
804 873 }
805 874
806 - if ( $limit == ' LIMIT 1' || $limit == 1 ) {
875 + if ( $limit === ' LIMIT 1' || $limit == 1 ) {
807 876 // return the first form object if we are only getting one form
808 877 $results = reset( $results );
809 878 }
810 879
@@ -823,9 +892,9 @@
823 892 */
824 893 public static function get_published_forms( $query = array(), $limit = 999, $inc_children = 'exclude' ) {
825 894 $query['is_template'] = 0;
826 895 $query['status'] = array( null, '', 'published' );
827 - if ( $inc_children == 'exclude' ) {
896 + if ( $inc_children === 'exclude' ) {
828 897 $query['parent_form_id'] = array( null, 0 );
829 898 }
830 899
831 900 $forms = self::getAll( $query, 'name', $limit );
@@ -861,18 +930,18 @@
861 930
862 931 foreach ( $results as $row ) {
863 932 if ( 'trash' != $row->status ) {
864 933 if ( $row->is_template ) {
865 - $counts['template'] ++;
934 + ++$counts['template'];
866 935 } else {
867 - $counts['published'] ++;
936 + ++$counts['published'];
868 937 }
869 938 } else {
870 - $counts['trash'] ++;
939 + ++$counts['trash'];
871 940 }
872 941
873 942 if ( 'draft' == $row->status ) {
874 - $counts['draft'] ++;
943 + ++$counts['draft'];
875 944 }
876 945
877 946 unset( $row );
878 947 }
@@ -938,11 +1007,11 @@
938 1007 $values['posted_form_id'] = FrmAppHelper::get_param( 'form', '', 'get', 'absint' );
939 1008 }
940 1009
941 1010 if ( $form->id == $values['posted_form_id'] ) {
942 - //if there are two forms on the same page, make sure not to submit both
1011 + // If there are two forms on the same page, make sure not to submit both.
943 1012 foreach ( $default_values as $var => $default ) {
944 - if ( $var == 'action' ) {
1013 + if ( $var === 'action' ) {
945 1014 $values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
946 1015 } else {
947 1016 $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
948 1017 }
@@ -1010,9 +1079,9 @@
1010 1079 return $values;
1011 1080 }
1012 1081
1013 1082 public static function get_current_form_id( $default_form = 'none' ) {
1014 - if ( 'first' == $default_form ) {
1083 + if ( 'first' === $default_form ) {
1015 1084 $form = self::get_current_form();
1016 1085 } else {
1017 1086 $form = self::maybe_get_current_form();
1018 1087 }
@@ -1023,9 +1092,9 @@
1023 1092
1024 1093 public static function maybe_get_current_form( $form_id = 0 ) {
1025 1094 global $frm_vars;
1026 1095
1027 - if ( isset( $frm_vars['current_form'] ) && $frm_vars['current_form'] && ( ! $form_id || $form_id == $frm_vars['current_form']->id ) ) {
1096 + if ( ! empty( $frm_vars['current_form'] ) && ( ! $form_id || $form_id == $frm_vars['current_form']->id ) ) {
1028 1097 return $frm_vars['current_form'];
1029 1098 }
1030 1099
1031 1100 $form_id = FrmAppHelper::get_param( 'form', $form_id, 'get', 'absint' );
@@ -1072,9 +1141,9 @@
1072 1141 $global_load = true;
1073 1142 $frm_vars['load_css'] = true;
1074 1143 }
1075 1144
1076 - return ( ( ! isset( $frm_vars['css_loaded'] ) || ! $frm_vars['css_loaded'] ) && $global_load );
1145 + return empty( $frm_vars['css_loaded'] ) && $global_load;
1077 1146 }
1078 1147
1079 1148 /**
1080 1149 * @since 4.06.03
@@ -1093,9 +1162,9 @@
1093 1162 return $visible;
1094 1163 }
1095 1164
1096 1165 public static function show_submit( $form ) {
1097 - $show = ( ! $form->is_template && $form->status == 'published' && ! FrmAppHelper::is_admin() );
1166 + $show = ( ! $form->is_template && $form->status === 'published' && ! FrmAppHelper::is_admin() );
1098 1167 $show = apply_filters( 'frm_show_submit_button', $show, $form );
1099 1168
1100 1169 return $show;
1101 1170 }
@@ -1103,9 +1172,9 @@
1103 1172 /**
1104 1173 * @since 2.3
1105 1174 */
1106 1175 public static function get_option( $atts ) {
1107 - $form = $atts['form'];
1176 + $form = $atts['form'];
1108 1177 $default = isset( $atts['default'] ) ? $atts['default'] : '';
1109 1178
1110 1179 return isset( $form->options[ $atts['option'] ] ) ? $form->options[ $atts['option'] ] : $default;
1111 1180 }
@@ -1132,8 +1201,50 @@
1132 1201 return ! empty( $form->options['ajax_submit'] );
1133 1202 }
1134 1203
1135 1204 /**
1205 + * Get the latest form available.
1206 + *
1207 + * @since 6.8
1208 + * @return object
1209 + */
1210 + public static function get_latest_form() {
1211 +
1212 + $args = array(
1213 + array(
1214 + 'or' => 1,
1215 + 'parent_form_id' => null,
1216 + 'parent_form_id <' => 1,
1217 + ),
1218 + 'is_template' => 0,
1219 + 'status !' => 'trash',
1220 + );
1221 +
1222 + return self::getAll( $args, 'created_at desc', 1 );
1223 + }
1224 +
1225 + /**
1226 + * Count and return total forms.
1227 + *
1228 + * @since 6.8
1229 + * @return int
1230 + */
1231 + public static function get_forms_count() {
1232 +
1233 + $args = array(
1234 + array(
1235 + 'or' => 1,
1236 + 'parent_form_id' => null,
1237 + 'parent_form_id <' => 1,
1238 + ),
1239 + 'is_template' => 0,
1240 + 'status !' => 'trash',
1241 + );
1242 +
1243 + return FrmDb::get_count( 'frm_forms', $args );
1244 + }
1245 +
1246 + /**
1136 1247 * @deprecated 2.03.05 This is still referenced in a few add ons (API, locations).
1137 1248 * @codeCoverageIgnore
1138 1249 *
1139 1250 * @param string $key
@@ -1147,9 +1258,9 @@
1147 1258 /**
1148 1259 * @deprecated 2.03.05 This is still referenced in the API add on as of v1.13.
1149 1260 * @codeCoverageIgnore
1150 1261 *
1151 - * @param string|int $id
1262 + * @param int|string $id
1152 1263 * @return string
1153 1264 */
1154 1265 public static function getKeyById( $id ) {
1155 1266 _deprecated_function( __FUNCTION__, '2.03.05', 'FrmForm::get_key_by_id' );