Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Date selector (datebox) control doesn’t allow future dates


r-a-y
Keymaster

@r-a-y

You can apply a filter to ‘bp_get_the_profile_field_datebox’ to add extra years:

`apply_filters( ‘bp_get_the_profile_field_datebox’, $html, $day, $month, $year, $default_select );`

Find the bp_get_the_profile_field_options() function in /buddypress/bp-xprofile/bp-xprofile-templatetags.php where this filter is defined, so you’ll have a better idea of how to override it.

Some sample code that you can add to your theme’s functions.php:
`function my_year_field ($html, $day, $month, $year, $default_select ) {
// your code to override the year field
}
add_filter( ‘bp_get_the_profile_field_datebox’, ‘my_year_field’, 10, 5 );
`

Skip to toolbar