SHARE
TWEET

bp_get_the_profile_field_datebox limit year

a guest Apr 3rd, 2013 99 Never
  1. function custom_bp_datebox($html, $type, $day, $month, $year, $field_id, $date) {      
  2.     if($type == 'year'){
  3.    
  4.         $html = '<option value=""' . selected( $year, '', false ) . '>----</option>';
  5.  
  6.         for ( $i = 2015; $i > 2010; $i-- ) {
  7.                 $html .= '<option value="' . $i .'"' . selected( $year, $i, false ) . '>' . $i . '</option>';
  8.         }
  9.     }
  10.     return $html;
  11. }
  12. add_filter( 'bp_get_the_profile_field_datebox', 'custom_bp_datebox',10,7);
RAW Paste Data
Top