本文整理汇总了PHP中tribe_events_is_view_enabled函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_events_is_view_enabled函数的具体用法?PHP tribe_events_is_view_enabled怎么用?PHP tribe_events_is_view_enabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_events_is_view_enabled函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tribe_events_the_mini_calendar_day_link
/**
* 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);
}
示例2: templateChooser
/**
* Pick the correct template to include
*
* @param string $template Path to template
*
* @return string Path to template
*/
public static function templateChooser($template)
{
$events = Tribe__Events__Main::instance();
do_action('tribe_tec_template_chooser', $template);
// no non-events need apply
if (!tribe_is_event_query()) {
return $template;
}
// if it's a single 404 event
if (is_single() && is_404()) {
return get_404_template();
}
if (!is_single() && !tribe_events_is_view_enabled($events->displaying) && 'day' != $events->displaying) {
return get_404_template();
}
// add the theme slug to the body class
add_filter('body_class', array(__CLASS__, 'theme_body_class'));
// add the template name to the body class
add_filter('body_class', array(__CLASS__, 'template_body_class'));
// user has selected a page/custom page template
if (tribe_get_option('tribeEventsTemplate', 'default') != '') {
if (!is_single() || !post_password_required()) {
add_action('loop_start', array(__CLASS__, 'setup_ecp_template'));
}
$template = locate_template(tribe_get_option('tribeEventsTemplate', 'default') == 'default' ? 'page.php' : tribe_get_option('tribeEventsTemplate', 'default'));
if ($template == '') {
$template = get_index_template();
}
// remove singular body class if sidebar-page.php
if ($template == get_stylesheet_directory() . '/sidebar-page.php') {
add_filter('body_class', array(__CLASS__, 'remove_singular_body_class'));
} else {
add_filter('body_class', array(__CLASS__, 'add_singular_body_class'));
}
} else {
$template = self::getTemplateHierarchy('default-template');
}
// if this is an oembed, override the wrapping template and use the embed template
if (Tribe__Templates::is_embed()) {
$template = self::getTemplateHierarchy('embed');
}
self::$template = $template;
return $template;
}
示例3: while
<!-- Events List -->
<?php
while ($day['events']->have_posts()) {
$day['events']->the_post();
?>
<?php
tribe_get_template_part('month/single', 'event');
?>
<?php
}
?>
<!-- View More -->
<?php
if ($day['view_more'] && tribe_events_is_view_enabled('day')) {
?>
<div class="tribe-events-viewmore">
<?php
$view_all_label = sprintf(_n('View 1 Event', 'View All %s Events', $day['total_events'], 'tribe-events-calendar'), $day['total_events']);
?>
<a href="<?php
echo $day['view_more'];
?>
"><?php
echo $view_all_label;
?>
»</a>
</div>
<?php
}
示例4: tribe_events_week_day_header
/**
* Return the text used in week day headers wrapped in a <span> tag and data attribute needed for mobile js.
*
* @return string
*/
function tribe_events_week_day_header()
{
$day = tribe_events_week_get_current_day();
$html = '<span data-full-date="' . $day['formatted_date'] . '">' . $day['formatted_date'] . '</span>';
// if day view is enabled and there are events on the day, make it a link to the day
if (tribe_events_is_view_enabled('day') && $day['has_events']) {
$html = '<a href="' . tribe_get_day_link(tribe_events_week_get_the_date(false)) . '" rel="bookmark">' . $html . '</span></a>';
}
return apply_filters('tribe_events_week_day_header', $html);
}
示例5: die
* @package TribeEventsCalendar
*
*/
if (!defined('ABSPATH')) {
die('-1');
}
$day = tribe_events_get_current_month_day();
$events_label = 1 === $day['total_events'] ? tribe_get_event_label_singular() : tribe_get_event_label_plural();
?>
<!-- Day Header -->
<div id="tribe-events-daynum-<?php
echo $day['daynum-id'];
?>
">
<?php
if ($day['total_events'] > 0 && tribe_events_is_view_enabled('day')) {
?>
<a href="<?php
echo esc_url(tribe_get_day_link($day['date']));
?>
"><?php
echo $day['daynum'];
?>
</a>
<?php
} else {
?>
<?php
echo $day['daynum'];
?>
<?php
示例6: while
</span>
</div>
<div class="tribe-grid-content-wrap">
<?php
while (tribe_events_week_have_days()) {
tribe_events_week_the_day();
?>
<div title="<?php
tribe_events_week_get_the_date();
?>
" class="column <?php
echo tribe_events_week_is_current_today() ? 'tribe-week-today' : '';
?>
">
<?php
if (tribe_events_is_view_enabled('day') && tribe_events_current_week_day_has_events()) {
?>
<a href="<?php
echo tribe_get_day_link(tribe_events_week_get_the_date(false));
?>
" rel="bookmark"><?php
tribe_events_week_get_the_day_display();
?>
</a>
<?php
} else {
?>
<?php
tribe_events_week_get_the_day_display();
?>
<?php