本文整理汇总了PHP中tribe_get_gridview_link函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_gridview_link函数的具体用法?PHP tribe_get_gridview_link怎么用?PHP tribe_get_gridview_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_get_gridview_link函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget_output
/**
* The main widget output function (called by the class's widget() function).
*
* @param array $args
* @param array $instance
* @param string $template_name The template name.
* @param string $subfolder The subfolder where the template can be found.
* @param string $namespace The namespace for the widget template stuff.
* @param string $pluginPath The pluginpath so we can locate the template stuff.
*/
function widget_output($args, $instance, $template_name = 'list-widget', $subfolder = 'widgets', $namespace = '/', $pluginPath = '')
{
global $wp_query, $tribe_ecp, $post;
extract($args, EXTR_SKIP);
// The view expects all these $instance variables, which may not be set without pro
$instance = wp_parse_args($instance, array('limit' => 5, 'title' => ''));
extract($instance, EXTR_SKIP);
// extracting $instance provides $title, $limit
$title = apply_filters('widget_title', $title);
if (!isset($category) || $category === '-1') {
$category = 0;
}
if (tribe_get_option('viewOption') == 'upcoming') {
$event_url = tribe_get_listview_link($category);
} else {
$event_url = tribe_get_gridview_link($category);
}
if (function_exists('tribe_get_events')) {
$args = array('eventDisplay' => 'upcoming', 'posts_per_page' => $limit);
if (!empty($category)) {
$args['tax_query'] = array(array('taxonomy' => TribeEvents::TAXONOMY, 'terms' => $category, 'field' => 'ID', 'include_children' => false));
}
$posts = tribe_get_events($args);
}
// if no posts, and the don't show if no posts checked, let's bail
if (!$posts && $no_upcoming_events) {
return;
}
/* Before widget (defined by themes). */
echo $before_widget;
/* Title of widget (before and after defined by themes). */
echo $title ? $before_title . $title . $after_title : '';
if ($posts) {
/* Display list of events. */
echo '<ol class="hfeed vcalendar">';
foreach ($posts as $post) {
setup_postdata($post);
include TribeEventsTemplates::getTemplateHierarchy('widgets/list-widget.php');
}
echo "</ol><!-- .hfeed -->";
/* Display link to all events */
echo '<p class="tribe-events-widget-link"><a href="' . $event_url . '" rel="bookmark">' . __('View All Events', 'tribe-events-calendar') . '</a></p>';
} else {
echo '<p>' . __('There are no upcoming events at this time.', 'tribe-events-calendar') . '</p>';
}
/* After widget (defined by themes). */
echo $after_widget;
wp_reset_query();
}
示例2: widget_output
function widget_output($args, $instance, $template_name = 'events-list-load-widget-display')
{
global $wp_query, $tribe_ecp, $post;
extract($args, EXTR_SKIP);
extract($instance, EXTR_SKIP);
// extracting $instance provides $title, $limit
$title = apply_filters('widget_title', $title);
if (!isset($category)) {
$category = null;
}
if (tribe_get_option('viewOption') == 'upcoming') {
$event_url = tribe_get_listview_link($category != -1 ? intval($category) : null);
} else {
$event_url = tribe_get_gridview_link($category != -1 ? intval($category) : null);
}
if (function_exists('tribe_get_events')) {
$posts = tribe_get_events('eventDisplay=upcoming&posts_per_page=' . $limit . '&eventCat=' . $category);
$template = TribeEventsTemplates::getTemplateHierarchy($template_name);
}
// if no posts, and the don't show if no posts checked, let's bail
if (!$posts && $no_upcoming_events) {
return;
}
/* Before widget (defined by themes). */
echo $before_widget;
/* Title of widget (before and after defined by themes). */
echo $title ? $before_title . $title . $after_title : '';
if ($posts) {
/* Display list of events. */
echo "<ul class='upcoming'>";
foreach ($posts as $post) {
setup_postdata($post);
include $template;
}
echo "</ul>";
/* Display link to all events */
echo '<div class="dig-in"><a href="' . $event_url . '">' . __('View All Events', 'tribe-events-calendar') . '</a></div>';
} else {
_e('There are no upcoming events at this time.', 'tribe-events-calendar');
}
/* After widget (defined by themes). */
echo $after_widget;
wp_reset_query();
}
示例3: widget
function widget($args, $instance)
{
global $wp_query, $post;
$old_post = $post;
extract($args, EXTR_SKIP);
extract($instance, EXTR_SKIP);
// extracting $instance provides $title, $limit, $no_upcoming_events, $start, $end, $venue, $address, $city, $state, $province'], $zip, $country, $phone , $cost
$title = apply_filters('widget_title', $title);
if (tribe_get_option('viewOption') == 'upcoming') {
$event_url = tribe_get_listview_link();
} else {
$event_url = tribe_get_gridview_link();
}
if (function_exists('tribe_get_events')) {
$posts = tribe_get_events('eventDisplay=upcoming&numResults=1&eventCat=' . $category);
$template = TribeEventsTemplates::getTemplateHierarchy('widget-featured-display');
}
// if no posts, and the don't show if no posts checked, let's bail
if (!$posts && isset($no_upcoming_events) && $no_upcoming_events) {
return;
}
/* Before widget (defined by themes). */
echo $before_widget;
/* Title of widget (before and after defined by themes). */
echo $title ? $before_title . $title . $after_title : '';
if ($posts) {
/* Display list of events. */
foreach ($posts as $post) {
setup_postdata($post);
include $template;
}
} else {
echo "<p>";
_e('There are no upcoming events at this time.', 'tribe-events-calendar-pro');
echo "</p>";
}
/* After widget (defined by themes). */
echo $after_widget;
$post = $old_post;
}
示例4: setup_gridview_in_bar
/**
* Set up the calendar view in the view selector in the tribe events bar.
*
* @param array $views The current views array.
*
* @return array The modified views array.
*/
public function setup_gridview_in_bar($views)
{
$views[] = array('displaying' => 'month', 'event_bar_hook' => 'tribe_events_month_before_template', 'anchor' => __('Month', 'the-events-calendar'), 'url' => tribe_get_gridview_link());
return $views;
}
示例5: 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) . '"';
}
}
示例6: esc_url
echo esc_url(admin_url('images/wpspin_light.gif'));
?>
" class="ajax-loading" id="ajax-loading" alt="" style='display: none'/>
</span>
</span>
<span class='tribe-events-calendar-buttons'>
<a class='tribe-events-button-off' href='<?php
echo tribe_get_listview_link();
?>
'><?php
_e('Event List', 'tribe-events-calendar');
?>
</a>
<a class='tribe-events-button-on' href='<?php
echo tribe_get_gridview_link();
?>
'><?php
_e('Calendar', 'tribe-events-calendar');
?>
</a>
</span>
</div><!-- tribe-events-calendar-header -->
<?php
tribe_calendar_grid();
// See the views/table.php template for customization
?>
<?php
if (function_exists('tribe_get_ical_link')) {
?>
<a title="<?php
示例7: 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('»', 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 . '"';
}
}
示例8: sp_get_gridview_link
/**
* @deprecated
*/
function sp_get_gridview_link($term = null)
{
_deprecated_function(__FUNCTION__, '2.0', 'tribe_get_gridview_link()');
return tribe_get_gridview_link($term);
}
示例9: 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;
}
示例10: showBreadcrumbs
//.........这里部分代码省略.........
if (in_array($type, array('single', 'attachment', 'woocommerce_product', 'tribe_event'))) {
if (!in_array($type, array('woocommerce_product', 'tribe_event')) && $args['show_all_filters']) {
$post_format = get_post_format($post_id);
if (($tpl_id = getTemplatePageId('only-' . $post_format)) > 0) {
$level++;
if ($level > $args['max_levels']) {
$rez_level = '...';
} else {
$rez_all .= (!empty($rez_all) ? $args['delimiter'] : '') . '<a class="all" href="' . get_permalink($tpl_id) . '">' . sprintf(__('All %s', 'themerex'), getPostFormatName($post_format, false)) . '</a>';
}
}
}
$cats = getCategoriesByPostId($post_id, $taxonomy);
$cat = $cats ? $cats[0] : false;
if ($cat) {
if (!in_array($cat['term_id'], $ex_cats)) {
$cat_link = get_term_link($cat['slug'], $cat['taxonomy']);
$level++;
if ($level > $args['max_levels']) {
$rez_level = '...';
} else {
$rez2 = '<a class="cat_post" href="' . $cat_link . '">' . getShortString($cat['name'], $args['truncate_title'], $args['truncate_add']) . '</a>' . (!empty($rez2) ? $args['delimiter'] : '') . $rez2;
}
}
} else {
$post_type = get_post_type($post_id);
$parentTax = 'category' . ($post_type == 'post' ? '' : '_' . $post_type);
}
} else {
if ($type == 'category') {
$cat = get_term_by('id', get_query_var('cat'), 'category', ARRAY_A);
} else {
if (themerex_strpos($type, 'woocommerce') !== false) {
if (is_product_category()) {
$cat = get_term_by('slug', get_query_var('product_cat'), 'product_cat', ARRAY_A);
}
} else {
if (themerex_strpos($type, 'tribe') !== false) {
if (tribe_is_event_category()) {
$cat = get_term_by('slug', get_query_var('tribe_events_cat'), 'tribe_events_cat', ARRAY_A);
}
}
}
}
}
if ($cat) {
$parent = $cat['parent'];
$parentTax = $cat['taxonomy'];
}
}
if ($parent) {
$cat = get_term_by('id', $parent, $parentTax, ARRAY_A);
if ($cat) {
if (!in_array($cat['term_id'], $ex_cats)) {
$cat_link = get_term_link($cat['slug'], $cat['taxonomy']);
$level++;
if ($level > $args['max_levels']) {
$rez_level = '...';
} else {
$rez2 = '<a class="cat_parent" href="' . $cat_link . '">' . getShortString($cat['name'], $args['truncate_title'], $args['truncate_add']) . '</a>' . (!empty($rez2) ? $args['delimiter'] : '') . $rez2;
}
}
$parent = $cat['parent'];
}
}
} while ($parent);
if (themerex_strpos($type, 'woocommerce') !== false && ($shop_id = get_option('woocommerce_shop_page_id')) > 0 && !in_array(themerex_strtolower($title), array(themerex_strtolower($shop_title = getPostTitle($shop_id))))) {
$rez_all = '<a class="all" href="' . get_permalink($shop_id) . '">' . $shop_title . '</a>' . (!empty($rez_all) ? $args['delimiter'] : '') . $rez_all;
}
if (themerex_strpos($type, 'tribe') !== false && !in_array(themerex_strtolower($title), array(__('All Events', 'themerex'), __('Tribe Events', 'themerex')))) {
$rez_all = '<a class="all" href="' . tribe_get_events_link() . '">' . __('All Events', 'themerex') . '</a>' . (!empty($rez_all) ? $args['delimiter'] : '') . $rez_all;
}
if ($args['show_all_posts'] && !in_array(themerex_strtolower($title), array(themerex_strtolower(__('All Posts', 'themerex')))) && ($blog_id = getTemplatePageId('blog')) > 0) {
$rez_all = '<a class="all" href="' . get_permalink($blog_id) . '">' . __('All Posts', 'themerex') . '</a>' . (!empty($rez_all) ? $args['delimiter'] : '') . $rez_all;
}
$rez3 = '';
if ($type == 'tribe_day' && is_object($post)) {
$rez3 .= (!empty($rez3) ? $args['delimiter'] : '') . '<a class="cat_parent" href="' . tribe_get_gridview_link(false) . '">' . date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())) . '</a>';
} else {
if (themerex_strpos($type, 'woocommerce') === false && is_archive() && is_object($post)) {
$year = get_the_time('Y');
$month = get_the_time('m');
if (is_day() || is_month()) {
$rez3 .= (!empty($rez3) ? $args['delimiter'] : '') . '<a class="cat_parent" href="' . get_year_link($year) . '">' . $year . '</a>';
}
if (is_day()) {
$rez3 .= (!empty($rez3) ? $args['delimiter'] : '') . '<a class="cat_parent" href="' . get_month_link($year, $month) . '">' . prepareDateForTranslation(get_the_date('F')) . '</a>';
}
}
}
if (!is_front_page()) {
// && !is_home()
$rez .= (isset($args['home']) && $args['home'] != '' ? '<a class="home" href="' . ($args['home_url'] ? $args['home_url'] : home_url()) . '">' . $args['home'] . '</a>' . $args['delimiter'] : '') . (!empty($rez_all) ? $rez_all . $args['delimiter'] : '') . (!empty($rez_level) ? $rez_level . $args['delimiter'] : '') . (!empty($rez2) ? $rez2 . $args['delimiter'] : '') . (!empty($rez3) ? $rez3 . $args['delimiter'] : '') . ($title ? '<span class="current">' . $title . '</span>' : '');
}
}
if ($args['echo'] && !empty($rez)) {
echo balanceTags($rez);
}
return $rez;
}