Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Forked from jkudish/gist:1981268
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/2004704 to your computer and use it in GitHub Desktop.
Save jo-snips/2004704 to your computer and use it in GitHub Desktop.
The Events Calendar: filtering years in The Events Calendar year dropdown - this will only work in 2.1+
<?php
// filter the number of years to go back
add_filter('tribe_years_to_go_back', 'my_tribe_years_to_go_back');
function my_tribe_years_to_go_back() {
return 2;
}
// filter the number of years to go forwards
add_filter('tribe_years_to_go_forward', 'tribe_years_to_go_forward');
function tribe_years_to_go_forward() {
return 3;
}
// filter the array itself - running this filter will overwrite the two above
add_filter('tribe_years_array', 'my_tribe_years_to_go_forward');
function my_tribe_years_to_go_forward() {
return array('2011', '2012', '2013');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment