Last active
January 18, 2019 01:05
-
-
Save cliffordp/a699255635f7266967284005d979a89d to your computer and use it in GitHub Desktop.
Filter the minDate and maxDate for The Events Calendar's "Custom Datepicker Start Date" extension. 7 days prior to Today through 1 month forward from today.
This file contains 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 minDate and maxDate for The Events Calendar's "Custom Datepicker | |
* Start Date" extension, which requires PHP 5.3+. | |
* | |
* 7 days prior to Today through 1 month forward from today. | |
* | |
* @see Tribe__Extension__Custom_Datepicker_Start_Date::get_min_date() | |
* @see Tribe__Extension__Custom_Datepicker_Start_Date::get_max_date() | |
* | |
* @link https://theeventscalendar.com/extensions/custom-datepicker-start-date/ | |
* @link https://secure.php.net/manual/class.dateinterval.php The format to follow. | |
* @link https://gist.github.com/cliffordp/a699255635f7266967284005d979a89d | |
*/ | |
add_filter( 'tribe_ext_start_datepicker_min_date_interval', function() { | |
return 'P7D'; | |
} ); | |
add_filter( 'tribe_ext_start_datepicker_max_date_interval', function() { | |
return 'P1M'; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment