本文整理汇总了PHP中tribe_get_day_link函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_day_link函数的具体用法?PHP tribe_get_day_link怎么用?PHP tribe_get_day_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_get_day_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: day_view_ical_link
/**
* Make sure ical link has the date in the URL instead of "today" on day view
*
* @param $link
*
* @return string
*/
public static function day_view_ical_link($link)
{
if (tribe_is_day()) {
global $wp_query;
$day = $wp_query->get('start_date');
$link = trailingslashit(esc_url(trailingslashit(tribe_get_day_link($day)) . '?ical=1'));
}
return $link;
}
开发者ID:AC85,项目名称:musikschule-wp-theme,代码行数:16,代码来源:iCal.php
示例2: tribe_the_day_link
/**
* Output an html link to a day
*
* @param string $date 'previous day', 'next day', 'yesterday', 'tomorrow', or any date string that strtotime() can parse
* @param string $text text for the link
* @return void
* @since 3.0
**/
function tribe_the_day_link($date = null, $text = null)
{
try {
if (is_null($text)) {
$text = tribe_get_the_day_link_label($date);
}
$date = tribe_get_the_day_link_date($date);
$link = tribe_get_day_link($date);
$html = '<a href="' . $link . '" data-day="' . $date . '" rel="prev">' . $text . '</a>';
} catch (OverflowException $e) {
$html = '';
}
echo apply_filters('tribe_the_day_link', $html);
}
开发者ID:jvcanote,项目名称:wp-the-events-calendar,代码行数:22,代码来源:day.php
示例3: tribe_the_day_link
/**
* Output an html link to a day
*
* @category Events
* @param string $date 'previous day', 'next day', 'yesterday', 'tomorrow', or any date string that strtotime() can parse
* @param string $text text for the link
*
**/
function tribe_the_day_link($date = null, $text = null)
{
$html = '';
try {
if (is_null($text)) {
$text = tribe_get_the_day_link_label($date);
}
$date = tribe_get_the_day_link_date($date);
$link = tribe_get_day_link($date);
$earliest = tribe_events_earliest_date(Tribe__Date_Utils::DBDATEFORMAT);
$latest = tribe_events_latest_date(Tribe__Date_Utils::DBDATEFORMAT);
if ($date >= $earliest && $date <= $latest) {
$html = '<a href="' . esc_url($link) . '" data-day="' . $date . '" rel="prev">' . $text . '</a>';
}
} catch (OverflowException $e) {
}
echo apply_filters('tribe_the_day_link', $html);
}
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:26,代码来源:day.php
示例4: tribe_get_day_link
<?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')) {
?>
<a href="<?php
echo tribe_get_day_link($day['date']);
?>
"><?php
echo $day['daynum'];
?>
</a>
<?php
} else {
?>
<?php
echo $day['daynum'];
?>
<?php
}
?>
开发者ID:Vinnica,项目名称:theboxerboston.com,代码行数:29,代码来源:single-day.php
示例5: view_more_link
/**
* Get the view more link
*
* @param integer $date
*
* @return string
*/
private static function view_more_link($date)
{
$day_link = tribe_get_day_link($date);
$tribe_bar_args = self::get_tribe_bar_args();
if (!empty($tribe_bar_args)) {
$day_link = add_query_arg($tribe_bar_args, $day_link);
}
return esc_url_raw($day_link);
}
开发者ID:acutedeveloper,项目名称:havering-intranet-development,代码行数:16,代码来源:Month.php
示例6: tribe_events_get_current_month_day
$day = tribe_events_get_current_month_day();
?>
<!-- Events List -->
<div class="tribe-month-single-day">
<div class="tribe-month-daynumber" id="tribe-events-daynum-<?php
echo trim($day['daynum']);
?>
">
<?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 trim($day['daynum']);
?>
</a>
<?php
} else {
?>
<a> <?php
echo trim($day['daynum']);
?>
</a>
<?php
}
?>
开发者ID:morganloehr,项目名称:chris-verna,代码行数:31,代码来源:single-day.php
示例7: tribe_the_day_link
/**
* Output an html link to a day
*
* @param $date 'previous day', 'next day', 'yesterday', 'tomorrow', or any date string that strtotime() can parse
* @param $text text for the link
* @param $term bool whether to show the link with the tribe event taxonomy
* @return void
* @since 3.0
**/
function tribe_the_day_link($date = null, $text = null, $term = true)
{
global $wp_query;
if (is_null($text)) {
switch (strtolower($date)) {
case null:
$text = __('Today', 'tribe-events-calendar-pro');
break;
case 'previous day':
$text = __('« Previous Day', 'tribe-events-calendar-pro');
break;
case 'next day':
$text = __('Next Day »', 'tribe-events-calendar-pro');
break;
case 'yesterday':
$text = __('Yesterday', 'tribe-events-calendar-pro');
break;
case 'tomorrow':
$text = __('Tomorrow', 'tribe-events-calendar-pro');
break;
default:
$text = date_i18n('Y-m-d', strtotime($date));
break;
}
}
switch ($date) {
case null:
$date = TribeEventsPro::instance()->todaySlug;
break;
case 'previous day':
$date = Date('Y-m-d', strtotime($wp_query->get('start_date') . " -1 day"));
break;
case 'next day':
$date = Date('Y-m-d', strtotime($wp_query->get('start_date') . " +1 day"));
break;
}
$link = tribe_get_day_link($date);
$html = '<a href="' . $link . '" data-day="' . $date . '" rel="prev">' . $text . '</a>';
echo apply_filters('tribe_the_day_link', $html);
}
开发者ID:TyRichards,项目名称:river_of_life,代码行数:49,代码来源:general.php
示例8: view_more_link
/**
* Get the view more link
*
* @param int $date
* @param array $args
* @return string
*/
private static function view_more_link($date, $args)
{
if (!empty(self::$event_daily_counts[$date]) && (int) self::$event_daily_counts[$date] > self::$posts_per_page_limit) {
$day_link = tribe_get_day_link($date);
if (!empty($args)) {
$day_link = add_query_arg($args, $day_link);
}
return $day_link;
}
return '';
}
开发者ID:estrategasdigitales,项目名称:Golone,代码行数:18,代码来源:month.php
示例9: ical_link
/**
* Get the link to download the ical version of day view
* @param $link
*
* @return string
*/
public function ical_link($link)
{
global $wp_query;
$day = $wp_query->get('start_date');
return trailingslashit(esc_url(trailingslashit(tribe_get_day_link($day)) . '?ical=1'));
}
开发者ID:chicosilva,项目名称:olharambiental,代码行数:12,代码来源:day.php
示例10: setup_dayview_in_bar
/**
* Add day view to the views selector in the tribe events bar.
*
* @param array $views The current array of views registered to the tribe bar.
*
* @return array The views registered with day view added.
*/
public function setup_dayview_in_bar($views)
{
$views[] = array('displaying' => 'day', 'anchor' => __('Day', 'the-events-calendar'), 'event_bar_hook' => 'tribe_events_before_template', 'url' => tribe_get_day_link());
return $views;
}
开发者ID:kevinaxu,项目名称:99boulders,代码行数:12,代码来源:Main.php
示例11: elseif
}
} elseif ($current_month > $month && $current_year == $year || $current_year > $year) {
$ppf = ' tribe-events-past';
} elseif ($current_month < $month && $current_year == $year || $current_year < $year) {
$ppf = ' tribe-events-future';
} else {
$ppf = false;
}
echo "<li class='tribe-events-thismonth" . $ppf . "'>";
//echo tribe_mini_display_day( $day, $monthView, $month, $date ) . "\n";
echo "<div class='daynum tribe-events-event' id='daynum_{$day}'>";
$abbrMonth = $tribe_ecp->monthsShort[date('M', $date)];
echo "<span class='tribe-month-name'>{$abbrMonth}</span>";
if (count($monthView[$day])) {
$dateLink = tribe_get_start_date('', false, 'Y-m-' . $day . '');
echo "<a href='" . tribe_get_day_link($dateLink) . "' class='tribe-events-mini-has-event'>";
echo $day;
echo "</a>";
} else {
echo $day;
}
echo "</div>";
echo "</li>";
}
// skip next month
while ($day + $offset <= $rows * 7) {
echo "<li class='tribe-events-othermonth'></li>";
$day++;
}
?>
</ul>
开发者ID:xdividr,项目名称:wi,代码行数:31,代码来源:table-mini.php
示例12: 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);
}
开发者ID:TravisSperry,项目名称:mpa_website,代码行数:15,代码来源:week.php
示例13: 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' : '';
?>
">
<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>
</div><!-- header column -->
<?php
}
?>
</div><!-- .tribe-grid-content-wrap -->
</div><!-- .tribe-grid-header -->
<?php
tribe_get_template_part('week/loop', 'grid-allday');
?>
<?php
开发者ID:TyRichards,项目名称:river_of_life,代码行数:31,代码来源:loop-grid.php
示例14: this_week_query
/**
* This Week Query
*
*
* @return object
*/
public static function this_week_query($this_week_query_vars)
{
//Only Get Private Events if user can view
$post_status = array('publish');
if (current_user_can('read_private_tribe_events')) {
$post_status[] = 'private';
}
//Get Events with Hide From Event Listings Checked
$hide_upcoming_ids = Tribe__Events__Query::getHideFromUpcomingEvents();
$this_week_widget_args = array('post_type' => Tribe__Events__Main::POSTTYPE, 'tax_query' => $this_week_query_vars['tax_query'], 'eventDisplay' => 'custom', 'start_date' => $this_week_query_vars['start_date'], 'end_date' => $this_week_query_vars['end_date'], 'post_status' => $post_status, 'tribeHideRecurrence' => false, 'post__not_in' => $hide_upcoming_ids, 'tribe_render_context' => 'widget', 'posts_per_page' => -1);
/**
* Filter This Week Widget args
*
* @param array $this_week_widget_args Arguments for This Week Widget
*/
$this_week_widget_args = apply_filters('tribe_events_pro_this_week_widget_query_args', $this_week_widget_args);
// Get all the upcoming events for this week
$events = tribe_get_events($this_week_widget_args, true);
//Days Array to set events for each day
$week_days = array();
//Set First Day
$day = $this_week_query_vars['start_date'];
//Get Day Range
$day_range = self::get_day_range();
//Todays Date According to WordPress
$timestamp_today = strtotime(current_time(Tribe__Date_Utils::DBDATEFORMAT));
//Date Formats from The Events Calendar
$display_date_format = apply_filters('tribe_events_this_week_date_format', 'jS');
$display_day_format = apply_filters('tribe_events_this_week_day_format', 'D ');
// Array used for calculation of php strtotime relative dates
$weekday_array = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
//Build an Array for Each Day
foreach ($day_range as $i => $day_number) {
//If Hide Weekends True then skip those days
if ($this_week_query_vars['hide_weekends'] === 'true' && ($day_number == 0 || $day_number == 6)) {
continue;
}
// figure out the $date that we're currently looking at
if ($day_number >= $day_range[0]) {
// usually we can just get the date for the next day
$date = date(Tribe__Date_Utils::DBDATEFORMAT, strtotime($day . "+{$i} days"));
} else {
//Start Day of week in the Middle and not in typical Sunday or Monday
$date = date(Tribe__Date_Utils::DBDATEFORMAT, strtotime("Next {$weekday_array[$day_number]}", strtotime($day)));
}
$this_week_events_sticky = $this_week_events = array();
if ($events->have_posts()) {
//loop through all events and sort based on sticky or not
foreach ($events->posts as $j => $event) {
if (tribe_event_is_on_date($date, $event)) {
$event->days_between = tribe_get_days_between($event->EventStartDate, $event->EventEndDate, true);
if ($event->menu_order == -1) {
$this_week_events_sticky[] = $event;
} else {
$this_week_events[] = $event;
}
}
}
}
//Merge the two arrays for the day only if sticky events are included for that day
if (!empty($this_week_events_sticky) && is_array($this_week_events_sticky) && is_array($this_week_events)) {
$this_week_events = array_merge($this_week_events_sticky, $this_week_events);
}
$formatted_date = date_i18n($display_date_format, strtotime($date));
$formatted_day = date_i18n($display_day_format, strtotime($date));
$timestamp_date = strtotime($date);
// create the "day" element to do display in the template
$week_days[] = array('date' => $date, 'day_number' => $day_number, 'formatted_date' => $formatted_date, 'formatted_day' => $formatted_day, 'is_today' => $timestamp_date == $timestamp_today ? true : false, 'is_past' => $timestamp_date < $timestamp_today ? true : false, 'is_future' => $timestamp_date > $timestamp_today ? true : false, 'this_week_events' => $this_week_events, 'has_events' => $this_week_events, 'total_events' => count($this_week_events), 'events_limit' => $this_week_query_vars['count'], 'view_more' => count($this_week_events) > $this_week_query_vars['count'] ? esc_url_raw(tribe_get_day_link($date)) : false);
}
return $week_days;
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:77,代码来源:This_Week.php
示例15: tribe_get_linked_day
/**
* Day View Link
*
* Get a link to day view
*
* @param string $date
* @param string $day
* @return string HTML linked date
* @since 2.0
*/
function tribe_get_linked_day($date, $day)
{
$return = '';
$return .= "<a href='" . tribe_get_day_link($date) . "'>";
$return .= $day;
$return .= "</a>";
return apply_filters('tribe_get_linked_day', $return);
}
开发者ID:mpaskew,项目名称:isc-dev,代码行数:18,代码来源:template-tags.php
注:本文中的tribe_get_day_link函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论