/** * Output a link for the mini calendar day, includes data attributes needed to update the event list below with ajax * * @return void **/ function tribe_events_the_mini_calendar_day_link() { $day = tribe_events_get_current_month_day(); $args = tribe_events_get_mini_calendar_args(); if ($day['total_events'] > 0) { // there are events on this day if ($args['count'] > 0) { // there is an event list under the calendar $html = '<a href="#" data-day="' . $day['date'] . '" class="tribe-mini-calendar-day-link">' . $day['daynum'] . '</a>'; } else { // there are no events under the calendar if (tribe_events_is_view_enabled('day')) { // day view is enabled ob_start(); tribe_the_day_link($day['date'], $day['daynum']); $html = ob_get_clean(); } else { // day view is disabled, just show that there are events on the day but don't link anywhere $html = '<a href="javascript:void(0)">' . $day['daynum'] . '</a>'; } } } else { $html = '<span class="tribe-mini-calendar-no-event">' . $day['daynum'] . '</span>'; } echo apply_filters('tribe_events_the_mini_calendar_day_link', $html); }
/** * Output a link for the mini calendar day, includes data attributes needed to update the event list below with ajax * * @return void * @since 3.0 * @author Jessica Yazbek **/ function tribe_events_the_mini_calendar_day_link() { $day = tribe_events_get_current_month_day(); $args = tribe_events_get_mini_calendar_args(); if ($args['count'] == 0) { ob_start(); tribe_the_day_link($day['date'], $day['daynum']); $html = ob_get_clean(); } elseif ($day['total_events'] > 0) { $html = '<a href="#" data-day="' . $day['date'] . '" class="tribe-mini-calendar-day-link">' . $day['daynum'] . '</a>'; } else { $html = '<span class="tribe-mini-calendar-no-event">' . $day['daynum'] . '</span>'; } echo apply_filters('tribe_events_the_mini_calendar_day_link', $html); }
/** * Month View Single Day * This file contains one day in the month grid * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/month/single-day.php * * @package TribeEventsCalendar * */ if (!defined('ABSPATH')) { die('-1'); } ?> <?php $day = tribe_events_get_current_month_day(); ?> <?php if ($day['date'] != 'previous' && $day['date'] != 'next') { ?> <!-- Day Header --> <div id="tribe-events-daynum-<?php echo $day['daynum']; ?> "> <?php if ($day['total_events'] > 0 && tribe_events_is_view_enabled('day')) { ?>
/** * Gets all events in the month * * @static * * @return array events in the month */ private static function get_month_view_events() { do_action('tribe_events_before_view'); // this will trigger the month view query setup $events_posts = array(); while (tribe_events_have_month_days()) { tribe_events_the_month_day(); $month_day = tribe_events_get_current_month_day(); if (isset($month_day['events']) && $month_day['total_events'] > 0) { $events_posts = array_merge($month_day['events']->posts, $events_posts); } } return $events_posts; }