This topic has 3 replies, 2 voices, and was last updated 10 years by SQadmin.

  • Author
  • #4663
     vanaila
    Participant

    Hi, when I put a date field in profile it stop in 1995.

    How can I break this restriction.

    Thanks for everything.

    #4754
     vanaila
    Participant

    please help ?

    #4757
     vanaila
    Participant

    find out what to change.

    For those who are interested.

    You have to uncomment this part in custom_buddypresse/bp-functions.php:

    if (! function_exists('bpfr_datebox_year_ranges')):
    /**
    * Filter year field only to allow minimum 18 year old members
    */
    function custom_bp_datebox($html, $type, $day, $month, $year, $field_id, $date) {
    $current_year = date("Y");
    $allowed_year = $current_year - 18;
    if($type == 'year'){

    $html = '<option value=""' . selected( $year, '', false ) . '>----</option>';

    for ( $i = $allowed_year; $i >= 1920; $i-- ) {
    $html .= '<option value="' . $i .'"' . selected( $year, $i, false ) . '>' . $i . '</option>';
    }
    }
    return $html;
    }
    endif;
    add_filter( 'bp_get_the_profile_field_datebox', 'custom_bp_datebox',10,7);

    #4811
     SQadmin
    Keymaster

    Hi,
    Similar topic here: https://archived.seventhqueen.com/forums/topic/change-min-age-year-profile-fields-should-be-updated-automatically

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?