public
Created

change the number of years in the dropdown for The Events Calendar

  • Download Gist
change-number-years.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php
 
/**
* this is lines 563-573 of /lib/tribe-view-helpers.class.php
*/
 
private static function years( ) {
$year = ( int )date_i18n( 'Y' );
// Back two years, forward 5
$year_list = array( $year - 1, $year, $year + 1, $year + 2, $year + 3, $year + 4, $year + 5 );
$years = array();
foreach( $year_list as $single_year ) {
$years[ $single_year ] = $single_year;
}
 
return $years;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.