Created
March 5, 2012 21:37
-
-
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+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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