Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Pasted at Line 25 in child theme copy of table-mini.php of tri.be's The Events Calendar
- * Let's force the widget to default to a specific month on the initial view.
- * Custom Month set up in ACF options as "mini-calendar-default-month-display"
- * (advancedcustomfields.com)
- * We assume if the request isn't ajax that it is indeed the initial view.
- */
- if (!defined('DOING_AJAX')) {
- $optional_start_date = get_field('mini_calendar_default_month_display', 'options') ? DateTime::createFromFormat('Ymd', get_field('mini_calendar_default_month_display', 'options')) : $current_date;
- $optional_start_date = $optional_start_date->format('Y-m-d');
- if ($current_date < $optional_start_date) {
- $current_date = $optional_start_date;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment