Created
February 8, 2012 03:56
-
-
Save jkudish/1765214 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Filters the year dropdown in The Events Calendar plugin's grid view | |
* shows the current year isntead of the last 2 | |
* | |
* @author Joachim Kudish @link http://jkudish.com | |
* @version 1.0 | |
* @param (string) $yearOptions the number of years options string | |
* @return (string) $yearOptions the filtered number of years options string | |
*/ | |
add_filter('tribe_month_year_dropdowns_yearOptions', 'tribe_filter_years'); | |
function tribe_filter_years($yearOptions) { | |
$currentYearString = '<option value=\''.date('Y').'\' selected="selected">'.date('Y').'</option>'; | |
$yearOptions = explode($currentYearString, $yearOptions); | |
return $currentYearString.$yearOptions[1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment