Skip to content

Instantly share code, notes, and snippets.

@jkudish
Created March 5, 2012 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jkudish/1981268 to your computer and use it in GitHub Desktop.
Save jkudish/1981268 to your computer and use it in GitHub Desktop.
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