• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tribe_get_month_view_date函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中tribe_get_month_view_date函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_month_view_date函数的具体用法?PHP tribe_get_month_view_date怎么用?PHP tribe_get_month_view_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了tribe_get_month_view_date函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: tribe_events_the_mini_calendar_header_attributes

/**
 * Output data attributes needed to update the month with ajax
 *
 * @return void
 **/
function tribe_events_the_mini_calendar_header_attributes()
{
    $args = tribe_events_get_mini_calendar_args();
    if (is_array($args['tax_query'])) {
        $args['tax_query'] = json_encode($args['tax_query']);
    }
    $html = '';
    $html .= ' data-count="' . esc_attr($args['count']) . '"';
    $html .= ' data-eventDate="' . esc_attr(tribe_get_month_view_date()) . '"';
    $html .= ' data-tax-query="' . esc_attr($args['tax_query']) . '"';
    $html .= ' data-nonce="' . wp_create_nonce('calendar-ajax') . '"';
    echo apply_filters('tribe_events_the_mini_calendar_header_attributes', $html);
}
开发者ID:TravisSperry,项目名称:mpa_website,代码行数:18,代码来源:widgets.php


示例2: wpv_upcoming_events_title

function wpv_upcoming_events_title($title)
{
    $upcoming = wpv_get_option('tribe-events-upcoming-title');
    $past = wpv_get_option('tribe-events-past-title');
    $month = wpv_get_option('tribe-events-month-title');
    if (!empty($upcoming) && (tribe_is_upcoming() || function_exists('tribe_is_map') && tribe_is_map() || function_exists('tribe_is_photo') && tribe_is_photo())) {
        return $upcoming;
    } elseif (!empty($past) && tribe_is_past()) {
        return $past;
    } elseif (!empty($month) && tribe_is_month()) {
        return sprintf($month, date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
    }
    return $title;
}
开发者ID:petrfaitl,项目名称:wordpress-event-theme,代码行数:14,代码来源:tribe-events-integration.php


示例3: get_header

<?php

/*
Template Name: Custom Homepage Template
*/
get_header();
$date = tribe_get_month_view_date();
?>

<h1 class="page-title visually-hidden">Welcome to Seniors Outdoors!</h1>

<div class="page-content">

    <section class="featured">
        <?php 
$found = false;
$wp_query = new WP_Query('post_type=tribe_events');
if ($wp_query->have_posts()) {
    while ($wp_query->have_posts()) {
        $wp_query->the_post();
        if (has_term('featured-event', 'tribe_events_cat') and !$found) {
            $other_info = get_field('other_info');
            $venue = tribe_get_venue();
            $found = true;
            ?>

    			    <h2 class="event-title purple-dark"><?php 
            the_title();
            ?>
</h2>
    			    <p class="single-space"><?php 
开发者ID:lizbur10,项目名称:js_finalproject,代码行数:31,代码来源:template_home.php


示例4: tribe_get_next_month_text

 /**
  * Next Month Text
  *
  * Returns a textual description of the next month
  *
  * @return string Name of the next month.
  */
 function tribe_get_next_month_text()
 {
     $tribe_ecp = Tribe__Events__Main::instance();
     try {
         $output = $tribe_ecp->getDateStringShortened($tribe_ecp->nextMonth(tribe_get_month_view_date()));
     } catch (OverflowException $e) {
         $output = '';
     }
     return apply_filters('tribe_get_next_month_text', $output);
 }
开发者ID:simple-beck,项目名称:project-gc,代码行数:17,代码来源:month.php


示例5: tribe_get_events_title

 /**
  * Event Title
  *
  * Return an event's title with pseudo-breadcrumb if on a category
  *
  * @param bool $depth include linked title
  * @return string title
  */
 function tribe_get_events_title($depth = true)
 {
     global $wp_query;
     $tribe_ecp = TribeEvents::instance();
     $title = __('Upcoming Events', 'tribe-events-calendar');
     // TODO: Use the displayed dates for the title
     if (tribe_is_past()) {
         $title = __('Past Events', 'tribe-events-calendar');
     }
     if (tribe_is_month()) {
         $title = sprintf(__('Events for %s', 'tribe-events-calendar'), date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
     }
     // day view title
     if (tribe_is_day()) {
         $title = __('Events for', 'tribe-events-calendar') . ' ' . date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date')));
     }
     if (is_tax($tribe_ecp->get_event_taxonomy())) {
         $cat = get_queried_object();
         if ($depth) {
             $title = '<a href="' . tribe_get_events_link() . '">' . $title . '</a>';
             $title .= ' &#8250; ' . $cat->name;
         } else {
             $title = $cat->name;
         }
     }
     return apply_filters('tribe_template_factory_debug', apply_filters('tribe_get_events_title', $title), 'tribe_get_events_title');
 }
开发者ID:estrategasdigitales,项目名称:Golone,代码行数:35,代码来源:loop.php


示例6: get_month_view_events

 /**
  * Gets all events in the current month, matching those presented in month view
  * by default (and therefore potentially including some events from the tail end
  * of the previous month and start of the following month).
  *
  * We build a fresh 'custom'-type query here rather than taking advantage of the
  * main query since page spoofing can render the actual query and results
  * inaccessible (and it cannot be recovered via a query reset).
  *
  * @return array events in the month
  */
 private static function get_month_view_events()
 {
     global $wp_query;
     $event_date = $wp_query->get('eventDate');
     $month = empty($event_date) ? tribe_get_month_view_date() : $wp_query->get('eventDate');
     $args = array('eventDisplay' => 'custom', 'start_date' => Tribe__Events__Template__Month::calculate_first_cell_date($month), 'end_date' => Tribe__Events__Template__Month::calculate_final_cell_date($month), 'posts_per_page' => -1, 'hide_upcoming' => true);
     /**
      * Provides an opportunity to modify the query args used to build a list of events
      * to export from month view.
      *
      * This could be useful where its desirable to limit the exported data set to only
      * those events taking place in the specific month being viewed (rather than an exact
      * match of the events shown in month view itself, which may include events from
      * adjacent months).
      *
      * @var array  $args
      * @var string $month
      */
     $args = (array) apply_filters('tribe_ical_feed_month_view_query_args', $args, $month);
     return tribe_get_events($args);
 }
开发者ID:AC85,项目名称:musikschule-wp-theme,代码行数:32,代码来源:iCal.php


示例7: tribe_events_the_header_attributes

 /**
  * Prints out data attributes used in the template header tags
  *
  * @category Events
  * @param string|null $current_view
  *
  * @return void
  * @todo move to template classes
  **/
 function tribe_events_the_header_attributes($current_view = null)
 {
     $attrs = array();
     $current_view = !empty($current_view) ? $current_view : basename(tribe_get_current_template());
     $attrs['data-title'] = wp_title('|', false, 'right');
     switch ($current_view) {
         case 'month.php':
             $attrs['data-view'] = 'month';
             $attrs['data-date'] = date('Y-m', strtotime(tribe_get_month_view_date()));
             $attrs['data-baseurl'] = tribe_get_gridview_link(false);
             break;
         case 'day.php':
             $attrs['data-startofweek'] = get_option('start_of_week');
             break;
         case 'list.php':
             $attrs['data-startofweek'] = get_option('start_of_week');
             $attrs['data-view'] = 'list';
             if (tribe_is_upcoming()) {
                 $attrs['data-baseurl'] = tribe_get_listview_link(false);
             } elseif (tribe_is_past()) {
                 $attrs['data-view'] = 'past';
                 $attrs['data-baseurl'] = tribe_get_listview_past_link(false);
             }
             break;
     }
     if (has_filter('tribe_events_mobile_breakpoint')) {
         $attrs['data-mobilebreak'] = tribe_get_mobile_breakpoint();
     }
     $attrs = apply_filters('tribe_events_header_attributes', $attrs, $current_view);
     foreach ($attrs as $attr => $value) {
         echo " {$attr}=" . '"' . esc_attr($value) . '"';
     }
 }
开发者ID:TMBR,项目名称:johnjohn,代码行数:42,代码来源:general.php


示例8: tribe_events_the_header_attributes

 /**
  * Prints out data attributes used in the template header tags
  *
  * @param string|null $current_view
  * @return void
  * @since 3.0
  **/
 function tribe_events_the_header_attributes($current_view = null)
 {
     $attrs = array();
     $current_view = !empty($current_view) ? $current_view : basename(tribe_get_current_template());
     $attrs['data-title'] = wp_title('&raquo;', false);
     switch ($current_view) {
         case 'month.php':
             $attrs['data-view'] = 'month';
             $attrs['data-date'] = date('Y-m', strtotime(tribe_get_month_view_date()));
             $attrs['data-baseurl'] = tribe_get_gridview_link(false);
             break;
         case 'list.php':
             $attrs['data-view'] = 'list';
             if (tribe_is_upcoming()) {
                 $attrs['data-baseurl'] = tribe_get_listview_link(false);
             } elseif (tribe_is_past()) {
                 $attrs['data-view'] = 'past';
                 $attrs['data-baseurl'] = tribe_get_listview_past_link(false);
             }
             break;
     }
     $attrs = apply_filters('tribe_events_header_attributes', $attrs, $current_view);
     foreach ($attrs as $attr => $value) {
         echo " {$attr}=" . '"' . $value . '"';
     }
 }
开发者ID:paarthd,项目名称:gslvpa,代码行数:33,代码来源:general.php


示例9: fitclub_tribe_alter_event_archive_titles

 function fitclub_tribe_alter_event_archive_titles($depth)
 {
     // Modify the titles here
     // Some of these include %1$s and %2$s, these will be replaced with relevant dates
     $title_upcoming = esc_html__('Upcoming Events', 'fitclub');
     // List View: Upcoming events
     $title_past = esc_html__('Past Events', 'fitclub');
     // List view: Past events
     $title_range = esc_html__('Events for %1$s - %2$s', 'fitclub');
     // List view: range of dates being viewed
     $title_month = esc_html__('Events for %1$s', 'fitclub');
     // Month View, %1$s = the name of the month
     $title_day = esc_html__('Events for %1$s', 'fitclub');
     // Day View, %1$s = the day
     $title_all = esc_html__('All events for %s', 'fitclub');
     // showing all recurrences of an event, %s = event title
     $title_week = esc_html__('Events for week of %s', 'fitclub');
     // Week view
     // Don't modify anything below this unless you know what it does
     global $wp_query;
     $tribe_ecp = Tribe__Events__Main::instance();
     $date_format = apply_filters('tribe_events_pro_page_title_date_format', tribe_get_date_format(true));
     // Default Title
     $title = $title_upcoming;
     // If there's a date selected in the tribe bar, show the date range of the currently showing events
     if (isset($_REQUEST['tribe-bar-date']) && $wp_query->have_posts()) {
         if ($wp_query->get('paged') > 1) {
             // if we're on page 1, show the selected tribe-bar-date as the first date in the range
             $first_event_date = tribe_get_start_date($wp_query->posts[0], false);
         } else {
             //otherwise show the start date of the first event in the results
             $first_event_date = tribe_format_date($_REQUEST['tribe-bar-date'], false);
         }
         $last_event_date = tribe_get_end_date($wp_query->posts[count($wp_query->posts) - 1], false);
         $title = sprintf($title_range, $first_event_date, $last_event_date);
     } elseif (tribe_is_past()) {
         $title = $title_past;
     }
     // Month view title
     if (tribe_is_month()) {
         $title = sprintf($title_month, date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
     }
     // Single view title
     if (tribe_is_event() && is_single()) {
         $title = get_the_title();
     }
     // Day view title
     if (tribe_is_day()) {
         $title = sprintf($title_day, date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date'))));
     }
     // All recurrences of an event
     if (function_exists('tribe_is_showing_all') && tribe_is_showing_all()) {
         $title = sprintf($title_all, get_the_title());
     }
     // Week view title
     if (function_exists('tribe_is_week') && tribe_is_week()) {
         $title = sprintf($title_week, date_i18n($date_format, strtotime(tribe_get_first_week_day($wp_query->get('start_date')))));
     }
     if (is_tax($tribe_ecp->get_event_taxonomy()) && $depth) {
         $cat = get_queried_object();
         $title = $cat->name;
     }
     return $title;
 }
开发者ID:themegrill,项目名称:fitclub,代码行数:64,代码来源:fitclub.php


示例10: axiom_tribe_events_get_period_links

 function axiom_tribe_events_get_period_links($links, $page, $delimiter = '')
 {
     if (!empty($links)) {
         return $links;
     }
     global $post;
     if ($page == 'tribe_day' && is_object($post)) {
         $links = '<a class="breadcrumbs_item cat_parent" href="' . tribe_get_gridview_link(false) . '">' . date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())) . '</a>';
     }
     return $links;
 }
开发者ID:pcuervo,项目名称:odc,代码行数:11,代码来源:plugin.tribe-events.php


示例11: get_events_title

function get_events_title()
{
    global $wp_query;
    $title = '';
    $date_format = apply_filters('tribe_events_pro_page_title_date_format', 'l, F jS Y');
    if (tribe_is_month() && !is_tax()) {
        $title = sprintf(__('Events for %s', 'tribe-events-calendar'), date_i18n('F Y', strtotime(tribe_get_month_view_date())));
    } elseif (class_exists('Tribe__Events__Pro__Main') && tribe_is_week()) {
        $title = sprintf(__('Events for week of %s', 'tribe-events-calendar-pro'), date_i18n($date_format, strtotime(tribe_get_first_week_day($wp_query->get('start_date')))));
    } elseif (class_exists('Tribe__Events__Pro__Main') && tribe_is_day()) {
        $title = __('Events for', 'tribe-events-calendar-pro') . ' ' . date_i18n($date_format, strtotime($wp_query->get('start_date')));
    } elseif (class_exists('Tribe__Events__Pro__Main') && (tribe_is_map() || tribe_is_photo())) {
        if (tribe_is_past()) {
            $title = __('Past Events', 'tribe-events-calendar-pro');
        } else {
            $title = __('Upcoming Events', 'tribe-events-calendar-pro');
        }
    } elseif (tribe_is_list_view()) {
        $title = __('Upcoming Events', 'dt_themes');
    } elseif (is_single()) {
        $title = $wp_query->post->post_title;
    } elseif (tribe_is_month() && is_tax()) {
        $term_slug = $wp_query->query_vars['tribe_events_cat'];
        $term = get_term_by('slug', $term_slug, 'tribe_events_cat');
        $name = $term->name;
        $title = $name;
    } elseif (is_tag()) {
        $name = 'Tag Archives';
        $title = $name;
    }
    echo '<h1>' . $title . '</h1>';
}
开发者ID:PNW3DEV,项目名称:iesdb-v1,代码行数:32,代码来源:register_public.php


示例12: getBlogTitle

 function getBlogTitle()
 {
     global $wp_query;
     $page = getBlogType();
     if (themerex_strpos($page, 'woocommerce') !== false) {
         if ($page == 'woocommerce_category') {
             $cat = get_term_by('slug', get_query_var('product_cat'), 'product_cat', ARRAY_A);
             return $cat['name'];
         } else {
             if ($page == 'woocommerce_tag') {
                 return sprintf(__('Tag: %s', 'themerex'), single_tag_title('', false));
             } else {
                 if ($page == 'woocommerce_cart') {
                     return __('Your cart', 'themerex');
                 } else {
                     if ($page == 'woocommerce_checkout') {
                         return __('Checkout', 'themerex');
                     } else {
                         if ($page == 'woocommerce_account') {
                             return __('Account', 'themerex');
                         } else {
                             if ($page == 'woocommerce_product') {
                                 return getPostTitle();
                             } else {
                                 if (($page_id = get_option('woocommerce_shop_page_id')) > 0) {
                                     return getPostTitle($page_id);
                                 }
                                 //__( 'Shop', 'themerex' );
                             }
                         }
                     }
                 }
             }
         }
     } else {
         if (themerex_strpos($page, 'tribe') !== false) {
             //return tribe_get_events_title();
             if ($page == 'tribe_category') {
                 $cat = get_term_by('slug', get_query_var('tribe_events_cat'), 'tribe_events_cat', ARRAY_A);
                 return $cat['name'];
             } else {
                 if ($page == 'tribe_tag') {
                     return sprintf(__('Tag: %s', 'themerex'), single_tag_title('', false));
                 } else {
                     if ($page == 'tribe_venue') {
                         return sprintf(__('Venue: %s', 'themerex'), tribe_get_venue());
                     } else {
                         if ($page == 'tribe_organizer') {
                             return sprintf(__('Organizer: %s', 'themerex'), tribe_get_organizer());
                         } else {
                             if ($page == 'tribe_day') {
                                 return sprintf(__('Daily Events: %s', 'themerex'), date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date'))));
                             } else {
                                 if ($page == 'tribe_month') {
                                     return sprintf(__('Monthly Events: %s', 'themerex'), date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
                                 } else {
                                     if ($page == 'tribe_event') {
                                         return getPostTitle();
                                     } else {
                                         return __('Tribe Events', 'themerex');
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         } else {
             if ($page == 'blog') {
                 return __('All Posts', 'themerex');
             } else {
                 if ($page == 'author') {
                     $curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
                     return sprintf(__('Author page: %s', 'themerex'), $curauth->display_name);
                 } else {
                     if ($page == 'error') {
                         return __('URL not found', 'themerex');
                     } else {
                         if ($page == 'search') {
                             return sprintf(__('Search Results for: %s', 'themerex'), get_search_query());
                         } else {
                             if ($page == 'archives_day') {
                                 return sprintf(__('Daily Archives: %s', 'themerex'), prepareDateForTranslation(get_the_date()));
                             } else {
                                 if ($page == 'archives_month') {
                                     return sprintf(__('Monthly Archives: %s', 'themerex'), prepareDateForTranslation(get_the_date('F Y')));
                                 } else {
                                     if ($page == 'archives_year') {
                                         return sprintf(__('Yearly Archives: %s', 'themerex'), get_the_date('Y'));
                                     } else {
                                         if ($page == 'category') {
                                             return sprintf(__('%s', 'themerex'), single_cat_title('', false));
                                         } else {
                                             if ($page == 'tag') {
                                                 return sprintf(__('Tag: %s', 'themerex'), single_tag_title('', false));
                                             } else {
                                                 if ($page == 'attachment') {
                                                     return sprintf(__('Attachment: %s', 'themerex'), getPostTitle());
                                                 } else {
                                                     if ($page == 'single') {
//.........这里部分代码省略.........
开发者ID:WestBayResidential,项目名称:wbrsorg,代码行数:101,代码来源:_wp_utils.php


示例13: get_home_url

    ?>
</a></h3>
                        </li>
                    <?php 
}
// End of the loop.
?>
                </ul>
            </div>
            <div class="top-news-wrapp">
                <h2><a href="<?php 
echo get_home_url() . '/events';
?>
">Навігатор подій</a></h2>
                <?php 
$title = sprintf(__('%1$s %2$s', 'tribe-events-calendar'), $events_label_plural, date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
?>
                <h5 class="today"><?php 
echo $title;
?>
</h5>
                 <?php 
tribe_show_month();
?>
                <?php 
?>
            </div>
<!--            <div class="event-calendar">-->
<!--                --><?php 
//tribe_show_month();
?>
开发者ID:Alexander-smirnov,项目名称:infomist,代码行数:31,代码来源:frontpage.php


示例14: tribe_get_next_month_text

 /**
  * Next Month Text
  *
  * Returns a textual description of the next month
  *
  * @return string Name of the next month.
  * @since 2.0
  */
 function tribe_get_next_month_text()
 {
     $tribe_ecp = TribeEvents::instance();
     $output = $tribe_ecp->getDateStringShortened($tribe_ecp->nextMonth(tribe_get_month_view_date()));
     return apply_filters('tribe_get_next_month_text', $output);
 }
开发者ID:TyRichards,项目名称:river_of_life,代码行数:14,代码来源:month.php


示例15: tribe_get_events_title

 /**
  * Event Title
  *
  * Return an event's title with pseudo-breadcrumb if on a category
  *
  * @param bool $depth include linked title
  * @return string title
  * @since 2.0
  */
 function tribe_get_events_title($depth = true)
 {
     global $wp_query;
     $tribe_ecp = TribeEvents::instance();
     $title = __('Upcoming Events', 'tribe-events-calendar');
     // TODO: Use the displayed dates for the title
     /*
     		if ( tribe_is_upcoming() || isset( $_REQUEST['tribe-bar-date'] ) ) {
     
     			$start_date = date( 'Y-m-d', strtotime( $wp_query->get( 'start_date' ) ) );
     
     			if ( $wp_query->get( 'start_date' ) && $start_date != date('Y-m-d') ) {
     
     				if ( get_query_var('paged') > 1 ) {
     					// get the date of the first post
     					$first_post = reset($wp_query->posts);
     					$start_date = date('Y-m-d', strtotime($first_post->EventStartDate));
     				}
     				$format = __('Events for %1$s', 'tribe-events-calendar');
     				$args = array(date_i18n( get_option( 'date_format', 'Y-m-d' ), strtotime($start_date) ));
     
     				// Get the date of the last post
     				if ( count($wp_query->posts) > 1 ) {
     					$last_post = end($wp_query->posts);
     					$last_post_date = date('Y-m-d', strtotime($last_post->EventStartDate));
     					if ( $last_post_date != $start_date ) {
     						$format = __('Events for %1$s through %2$s', 'tribe-events-calendar');
     						$args[] = date_i18n( get_option( 'date_format', 'Y-m-d' ), strtotime($last_post_date) );
     					}
     				}
     				$title = vsprintf($format, $args); 
     			}
     		} else */
     if (tribe_is_past()) {
         $title = __('Past Events', 'tribe-events-calendar');
     }
     if (tribe_is_month()) {
         $title = sprintf(__('Events for %s', 'tribe-events-calendar'), date_i18n(__('F Y', 'tribe-events-calendar'), strtotime(tribe_get_month_view_date())));
     }
     if (is_tax($tribe_ecp->get_event_taxonomy())) {
         $cat = get_queried_object();
         if ($depth) {
             $title = '<a href="' . tribe_get_events_link() . '">' . $title . '</a>';
             $title .= ' &#8250; ' . $cat->name;
         } else {
             $title = $cat->name;
         }
     }
     return apply_filters('tribe_template_factory_debug', apply_filters('tribe_get_events_title', $title), 'tribe_get_events_title');
 }
开发者ID:robertark,项目名称:the-events-calendar,代码行数:59,代码来源:loop.php


示例16: sp_get_month_view_date

 /**
  * @deprecated
  */
 function sp_get_month_view_date()
 {
     _deprecated_function(__FUNCTION__, '2.0', 'tribe_get_month_view_date()');
     return tribe_get_month_view_date();
 }
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:8,代码来源:deprecated.php


示例17: tribe_get_next_month_text

 /**
  * Next Month Text
  *
  * Returns a textual description of the next month
  *
  * @return string Name of the next month.
  * @since 2.0
  */
 function tribe_get_next_month_text()
 {
     $tribe_ecp = TribeEvents::instance();
     return $tribe_ecp->getDateString($tribe_ecp->nextMonth(tribe_get_month_view_date()));
 }
开发者ID:EfncoPlugins,项目名称:the-events-calendar,代码行数:13,代码来源:calendar.php


示例18: tribe_get_events_title

 /**
  * Event Title
  *
  * Return an event's title with pseudo-breadcrumb if on a category
  *
  * @param bool $depth include linked title
  *
  * @return string title
  * @todo move logic to template classes
  */
 function tribe_get_events_title($depth = true)
 {
     $events_label_plural = tribe_get_event_label_plural();
     global $wp_query;
     $tribe_ecp = Tribe__Events__Main::instance();
     $title = sprintf(__('Upcoming %s', 'tribe-events-calendar'), $events_label_plural);
     // If there's a date selected in the tribe bar, show the date range of the currently showing events
     if (isset($_REQUEST['tribe-bar-date']) && $wp_query->have_posts()) {
         if ($wp_query->get('paged') > 1) {
             // if we're on page 1, show the selected tribe-bar-date as the first date in the range
             $first_event_date = tribe_get_start_date($wp_query->posts[0], false);
         } else {
             //otherwise show the start date of the first event in the results
             $first_event_date = tribe_event_format_date($_REQUEST['tribe-bar-date'], false);
         }
         $last_event_date = tribe_get_end_date($wp_query->posts[count($wp_query->posts) - 1], false);
         $title = sprintf(__('%1$s for %2$s - %3$s', 'tribe-events-calendar'), $events_label_plural, $first_event_date, $last_event_date);
     } elseif (tribe_is_past()) {
         $title = sprintf(__('Past %s', 'tribe-events-calendar'), $events_label_plural);
     }
     if (tribe_is_month()) {
         $title = sprintf(__('%1$s for %2$s', 'tribe-events-calendar'), $events_label_plural, date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
     }
     // day view title
     if (tribe_is_day()) {
         $title = sprintf(__('%1$s for %2$s', 'tribe-events-calendar'), $events_label_plural, date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date'))));
     }
     if (is_tax($tribe_ecp->get_event_taxonomy()) && $depth) {
         $cat = get_queried_object();
         $title = '<a href="' . esc_url(tribe_get_events_link()) . '">' . $title . '</a>';
         $title .= ' &#8250; ' . $cat->name;
     }
     return apply_filters('tribe_get_events_title', $title, $depth);
 }
开发者ID:NallelyFlores89,项目名称:cronica-ambiental,代码行数:44,代码来源:loop.php


示例19: setup_view

 /**
  * Sets up an array of $days based on the current query, that can be used in the calendar loop
  *
  * @return void
  **/
 public function setup_view()
 {
     $requested_date = isset(self::$args['eventDate']) ? self::$args['eventDate'] : tribe_get_month_view_date();
     $first_day_of_month = date('Y-m-01', strtotime($requested_date));
     $first_grid_date = $this->calculate_first_cell_date($requested_date);
     $final_grid_date = $this->calculate_final_cell_date($requested_date);
     $days = array();
     $this->setup_tribe_bar_args();
     $this->current_day_vals();
     do_action('log', 'setup view month view args', 'tribe-month', self::$args);
     do_action('log', 'eventDate', 'tribe-events-query', $first_day_of_month);
     self::$hide_upcoming_ids = TribeEventsQuery::getHideFromUpcomingEvents();
     self::get_daily_counts($first_grid_date, $final_grid_date);
     $date = $first_grid_date;
     // Start with the first grid date
     $empty = new WP_Query();
     // Use for empty days
     // Populate complete date range including leading/trailing days from adjacent months
     while ($date <= $final_grid_date) {
         $day = (int) substr($date, -2);
         $total_events = !empty(self::$event_daily_counts[$date]) ? self::$event_daily_counts[$date] : 0;
         $prev_month = (int) substr($date, 5, 2) < (int) substr($requested_date, 5, 2);
         $next_month = (int) substr($date, 5, 2) > (int) substr($requested_date, 5, 2);
         $month_type = self::CURRENT_MONTH;
         if ($prev_month) {
             $month_type = self::PREVIOUS_MONTH;
         }
         if ($next_month) {
             $month_type = self::NEXT_MONTH;
         }
         $days[] = array('daynum' => $day, 'date' => $date, 'events' => $total_events ? self::get_daily_events($date) : $empty, 'total_events' => $total_events, 'view_more' => self::view_more_link($date, self::$tribe_bar_args), 'month' => $month_type);
         // Record the indicies marking the portion of the array relating to the current month
         if (!isset($this->current_month_begins) && self::CURRENT_MONTH === $month_type) {
             $this->current_month_begins = count($days) - 1;
         }
         if (isset($this->current_month_begins) && !isset($this->current_month_ends) && self::CURRENT_MONTH !== $month_type) {
             $this->current_month_ends = count($days) - 1;
         }
         // Advance forward one day
         $date = date(TribeDateUtils::DBDATEFORMAT, strtotime("{$date} +1 day"));
     }
     // If the month ended without bleeding into the next month, our current_month_ends property may not be set
     if (!isset($this->current_month_ends)) {
         $this->current_month_ends = count($days) - 1;
     }
     // store set of found days for use in calendar loop functions
     self::$calendar_days = $days;
 }
开发者ID:derwegas,项目名称:strubbelkinder,代码行数:53,代码来源:month.php


示例20: setup_view

 /**
  * Sets up an array of $days based on the current query, that can be used in the calendar loop
  *
  * @return void
  **/
 public function setup_view()
 {
     do_action('log', 'setup view month view args', 'tribe-month', self::$args);
     $requested_date = isset(self::$args['eventDate']) ? self::$args['eventDate'] : tribe_get_month_view_date();
     $first_day_of_month = date('Y-m-01', strtotime($requested_date));
     do_action('log', 'eventDate', 'tribe-events-query', $first_day_of_month);
     // get all upcoming ids to hide so we're not querying 31 times
     self::$hide_upcoming_ids = TribeEventsQuery::getHideFromUpcomingEvents();
     $year = date('Y', strtotime($first_day_of_month));
     $month = date('m', strtotime($first_day_of_month));
     $startOfWeek = get_option('start_of_week', 0);
     self::get_daily_counts($first_day_of_month);
     if (empty(self::$tribe_bar_args)) {
         foreach ($_REQUEST as $key => $value) {
             if ($value && strpos($key, 'tribe') === 0 && $key != 'tribe-bar-date') {
                 self::$tribe_bar_args[$key] = $value;
             }
         }
     }
     // Var'ng up days, months and years
     self::$today = date_i18n('d');
     self::$current_month = date_i18n('m');
     self::$current_year = date_i18n('Y');
     // single dimensional array of days for the month
     $days = array();
     // setup counters
     $rawOffset = date('w', strtotime($first_day_of_month)) - $startOfWeek;
     $prev_month_offset = (int) ($rawOffset < 0 ? $rawOffset + 7 : $rawOffset);
     // month begins on day x
     $days_in_month = (int) date('t', strtotime($first_day_of_month));
     $days_in_calendar = $days_in_month + $prev_month_offset;
     while ($days_in_calendar % 7 > 0) {
         $days_in_calendar++;
     }
     $cur_calendar_day = 0;
     // fill month with required days for previous month
     if ($prev_month_offset > 0) {
         $days = array_fill(0, $prev_month_offset, array('date' => 'previous'));
     }
     // get $cur_calendar_day up to speed
     $cur_calendar_day += $prev_month_offset;
     $empty_query = new WP_Query();
     // add days for this month
     for ($i = 0; $i < $days_in_month; $i++) {
         $day = $i + 1;
         $date = date('Y-m-d', strtotime("{$year}-{$month}-{$day}"));
         $total_events = !empty(self::$event_daily_counts[$date]) ? self::$event_daily_counts[$date] : 0;
         $days[] = array('daynum' => $day, 'date' => $date, 'events' => $total_events ? self::get_daily_events($date) : $empty_query, 'total_events' => $total_events, 'view_more' => self::view_more_link($date, self::$tribe_bar_args));
     }
     // get $cur_calendar_day up to speed
     $cur_calendar_day += $days_in_month;
     // check if $cur_calendar_day is less than $days_in_calendar, if so, add days for next month
     if ($cur_calendar_day < $days_in_calendar) {
         $days = array_merge($days, array_fill($cur_calendar_day, $days_in_calendar - $cur_calendar_day, array('date' => 'next')));
     }
     // store set of found days for use in calendar loop functions
     self::$calendar_days = $days;
 }
开发者ID:estrategasdigitales,项目名称:Golone,代码行数:63,代码来源:month.php



注:本文中的tribe_get_month_view_date函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tribe_get_next_month_text函数代码示例发布时间:2022-05-23
下一篇:
PHP tribe_get_meta_group函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap