| @@ -60,9 +60,9 @@ | ||
| 60 | 60 | |
| 61 | 61 | if ( ! $form || ! isset( $form->id ) ) { |
| 62 | 62 | $form = FrmForm::getOne( $field->form_id ); |
| 63 | 63 | } |
| 64 | - } | |
| 64 | + }//end foreach | |
| 65 | 65 | |
| 66 | 66 | FrmAppHelper::unserialize_or_decode( $form->options ); |
| 67 | 67 | if ( is_array( $form->options ) ) { |
| 68 | 68 | $values = array_merge( $values, $form->options ); |
| @@ -81,9 +81,9 @@ | ||
| 81 | 81 | * |
| 82 | 82 | * @param object $field |
| 83 | 83 | */ |
| 84 | 84 | private static function prepare_field_default_value( &$field ) { |
| 85 | - //If checkbox, multi-select dropdown, or checkbox data from entries field, the value should be an array | |
| 85 | + // If checkbox, multi-select dropdown, or checkbox data from entries field, the value should be an array. | |
| 86 | 86 | $return_array = FrmField::is_field_with_multiple_values( $field ); |
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | 89 | * Do any shortcodes in default value and allow customization of default value. |
| @@ -101,11 +101,11 @@ | ||
| 101 | 101 | * This function is used when the form is first loaded and on all page turns *for a new entry* |
| 102 | 102 | * |
| 103 | 103 | * @since 2.0.13 |
| 104 | 104 | * |
| 105 | - * @param object $field - this is passed by reference since it is an object | |
| 105 | + * @param object $field - this is passed by reference since it is an object. | |
| 106 | 106 | * @param boolean $reset |
| 107 | - * @param array $args | |
| 107 | + * @param array $args | |
| 108 | 108 | * |
| 109 | 109 | * @return string|array $new_value |
| 110 | 110 | */ |
| 111 | 111 | private static function get_field_value_for_new_entry( $field, $reset, $args ) { |
| @@ -127,9 +127,9 @@ | ||
| 127 | 127 | * |
| 128 | 128 | * @since 2.01.0 |
| 129 | 129 | * |
| 130 | 130 | * @param object $field |
| 131 | - * @param array $args | |
| 131 | + * @param array $args | |
| 132 | 132 | * |
| 133 | 133 | * @return boolean $value_is_posted |
| 134 | 134 | */ |
| 135 | 135 | public static function value_is_posted( $field, $args ) { |
| @@ -260,10 +260,10 @@ | ||
| 260 | 260 | /** |
| 261 | 261 | * Prepare the saved value for display |
| 262 | 262 | * |
| 263 | 263 | * @param array|string $value |
| 264 | - * @param object $field | |
| 265 | - * @param array $atts | |
| 264 | + * @param object $field | |
| 265 | + * @param array $atts | |
| 266 | 266 | * |
| 267 | 267 | * @return string |
| 268 | 268 | */ |
| 269 | 269 | public static function display_value( $value, $field, $atts = array() ) { |
| @@ -401,11 +401,11 @@ | ||
| 401 | 401 | * Check if field has an "Other" option and if any other values are posted |
| 402 | 402 | * |
| 403 | 403 | * @since 2.0 |
| 404 | 404 | * |
| 405 | - * @param object $field | |
| 405 | + * @param object $field | |
| 406 | 406 | * @param string|array $value |
| 407 | - * @param array $args | |
| 407 | + * @param array $args | |
| 408 | 408 | */ |
| 409 | 409 | public static function maybe_set_other_validation( $field, &$value, &$args ) { |
| 410 | 410 | $args['other'] = false; |
| 411 | 411 | if ( ! $value || ! FrmAppHelper::pro_is_installed() ) { |
| @@ -442,11 +442,11 @@ | ||
| 442 | 442 | * Sets radio or checkbox value equal to "other" value if it is set - FOR REPEATING SECTIONS |
| 443 | 443 | * |
| 444 | 444 | * @since 2.0 |
| 445 | 445 | * |
| 446 | - * @param object $field | |
| 446 | + * @param object $field | |
| 447 | 447 | * @param string|array $value |
| 448 | - * @param array $args | |
| 448 | + * @param array $args | |
| 449 | 449 | */ |
| 450 | 450 | public static function set_other_repeating_vals( $field, &$value, &$args ) { |
| 451 | 451 | if ( ! $args['parent_field_id'] ) { |
| 452 | 452 | return; |
| @@ -475,11 +475,11 @@ | ||
| 475 | 475 | * |
| 476 | 476 | * @since 2.0 |
| 477 | 477 | * |
| 478 | 478 | * @param string|array $value |
| 479 | - * @param string|array $other_vals (usually of posted values) | |
| 480 | - * @param object $field | |
| 481 | - * @param array $args | |
| 479 | + * @param string|array $other_vals (usually of posted values). | |
| 480 | + * @param object $field | |
| 481 | + * @param array $args | |
| 482 | 482 | */ |
| 483 | 483 | public static function set_other_validation_val( &$value, $other_vals, $field, &$args ) { |
| 484 | 484 | // Checkboxes and multi-select dropdowns. |
| 485 | 485 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
| @@ -521,10 +521,10 @@ | ||
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | } elseif ( $field->options[ $other_key ] == $value ) { |
| 524 | 524 | $value = $other_vals; |
| 525 | - } | |
| 526 | - } | |
| 525 | + }//end if | |
| 526 | + }//end if | |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | /** |
| 530 | 530 | * Add submitted values to a string for spam checking. |
| @@ -599,16 +599,17 @@ | ||
| 599 | 599 | |
| 600 | 600 | // finally get the correct version number |
| 601 | 601 | $known = array( 'Version', $ub, 'other' ); |
| 602 | 602 | $pattern = '#(?<browser>' . join( '|', $known ) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#'; |
| 603 | - preg_match_all( $pattern, $u_agent, $matches ); // get the matching numbers | |
| 603 | + // Get the matching numbers. | |
| 604 | + preg_match_all( $pattern, $u_agent, $matches ); | |
| 604 | 605 | |
| 605 | 606 | // see how many we have |
| 606 | 607 | $i = count( $matches['browser'] ); |
| 607 | 608 | |
| 608 | 609 | if ( $i > 1 ) { |
| 609 | - //we will have two since we are not using 'other' argument yet | |
| 610 | - //see if version is before or after the name | |
| 610 | + // We will have two since we are not using 'other' argument yet | |
| 611 | + // see if version is before or after the name. | |
| 611 | 612 | if ( strripos( $u_agent, 'Version' ) < strripos( $u_agent, $ub ) ) { |
| 612 | 613 | $version = $matches['version'][0]; |
| 613 | 614 | } else { |
| 614 | 615 | $version = $matches['version'][1]; |
| @@ -656,9 +657,9 @@ | ||
| 656 | 657 | <span class="frm_link_label"><?php echo esc_html( $link['label'] ); ?></span> |
| 657 | 658 | </a> |
| 658 | 659 | </div> |
| 659 | 660 | <?php |
| 660 | - } | |
| 661 | + }//end foreach | |
| 661 | 662 | } |
| 662 | 663 | |
| 663 | 664 | /** |
| 664 | 665 | * @since 3.0 |
| @@ -798,12 +799,14 @@ | ||
| 798 | 799 | return $status; |
| 799 | 800 | } |
| 800 | 801 | |
| 801 | 802 | if ( empty( $status ) ) { |
| 802 | - return self::SUBMITTED_ENTRY_STATUS; // If the status is empty, let's default to 0. | |
| 803 | + // If the status is empty, let's default to 0. | |
| 804 | + return self::SUBMITTED_ENTRY_STATUS; | |
| 803 | 805 | } |
| 804 | 806 | |
| 805 | - return self::DRAFT_ENTRY_STATUS; // If it has a value that isn't in the array, let's default to 1. There may be old entries that don't have a value for is_draft. | |
| 807 | + // If it has a value that isn't in the array, let's default to 1. There may be old entries that don't have a value for is_draft. | |
| 808 | + return self::DRAFT_ENTRY_STATUS; | |
| 806 | 809 | } |
| 807 | 810 | |
| 808 | 811 | /** |
| 809 | 812 | * Return entry status label based on passed value. |
| @@ -823,12 +826,13 @@ | ||
| 823 | 826 | /** |
| 824 | 827 | * Get all entry statuses. |
| 825 | 828 | * |
| 826 | 829 | * @since 6.5 |
| 830 | + * @since 6.6 function went from private to public. | |
| 827 | 831 | * |
| 828 | 832 | * @return array<string> |
| 829 | 833 | */ |
| 830 | - private static function get_entry_statuses() { | |
| 834 | + public static function get_entry_statuses() { | |
| 831 | 835 | |
| 832 | 836 | $default_entry_statuses = array( |
| 833 | 837 | self::SUBMITTED_ENTRY_STATUS => __( 'Submitted', 'formidable' ), |
| 834 | 838 | self::DRAFT_ENTRY_STATUS => __( 'Draft', 'formidable' ), |
| @@ -846,9 +850,9 @@ | ||
| 846 | 850 | */ |
| 847 | 851 | $extended_entry_status = apply_filters( 'frm_entry_statuses', array() ); |
| 848 | 852 | |
| 849 | 853 | if ( ! is_array( $extended_entry_status ) ) { |
| 850 | - _doing_it_wrong( __METHOD__, esc_html__( 'Entry status must be return in array format.', 'formidable' ), 'x.x' ); | |
| 854 | + _doing_it_wrong( __METHOD__, esc_html__( 'Entry status must be return in array format.', 'formidable' ), '6.5' ); | |
| 851 | 855 | $extended_entry_status = array(); |
| 852 | 856 | } |
| 853 | 857 | |
| 854 | 858 | $existing_entry_statuses = array_replace( $default_entry_statuses, $extended_entry_status ); |