Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Forked from jkudish/change-number-years.php
Created March 9, 2012 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jo-snips/2004707 to your computer and use it in GitHub Desktop.
Save jo-snips/2004707 to your computer and use it in GitHub Desktop.
The Events Calendar: change the number of years in the dropdown for The Events Calendar
<?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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment