Beispiel #1
0
/**
 * 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);
}
Beispiel #2
0
/**
 * 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);
}
<?php

/**
 * Events Pro Mini Calendar Widget
 * This is the template for the output of the mini calendar widget.
 *
 * Override this template in your own theme by creating a file at [your-theme]/tribe-events/pro/widgets/mini-calendar-widget.php
 *
 * @version 4.3
 * @package TribeEventsCalendarPro
 *
 */
if (!defined('ABSPATH')) {
    die('-1');
}
$args = tribe_events_get_mini_calendar_args();
?>

<!-- Removing this wrapper class will break the calendar JavaScript, please avoid and extend as needed -->

<div class="tribe-mini-calendar-wrapper">

	<!-- Grid -->
	<?php 
$month_widget_args = array('tax_query' => $args['tax_query'], 'eventDate' => $args['eventDate'], 'suppress_nothing_found_notice' => true, 'tribe_render_context' => 'widget');
/**
 * Filter Mini Calendar Widget tribe_show_month args
 *
 * @param array $month_widget_args Arguments for the Mini Calendar Widget's call to tribe_show_month
 */
$month_widget_args = apply_filters('tribe_events_pro_min_calendar_widget_query_args', $month_widget_args);