本文整理汇总了PHP中tribe_get_view函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_view函数的具体用法?PHP tribe_get_view怎么用?PHP tribe_get_view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_get_view函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: tribe_show_month
/**
* Display a month
*
* Inline example:
* < code >
* <?php
* // output the events in May 2016 using the full month view template
* tribe_show_month( array( 'eventDate' => '2016-05-01' ) )
* ?>
* </ code >
*
* @param array $args query args to pass to the month view
* @param string $template_path template to use, defaults to the full month view
* @return void
* @author Jessica Yazbek
* @since 3.0
**/
function tribe_show_month($args = array(), $template_path = 'month/content')
{
// temporarily unset the tribe bar params so they don't apply
$hold_tribe_bar_args = array();
foreach ($_REQUEST as $key => $value) {
if ($value && strpos($key, 'tribe-bar-') === 0) {
$hold_tribe_bar_args[$key] = $value;
unset($_REQUEST[$key]);
}
}
do_action('tribe_events_before_show_month');
new Tribe_Events_Month_Template($args);
tribe_get_view($template_path);
do_action('tribe_events_after_show_month');
// reinstate the tribe bar params
if (!empty($hold_tribe_bar_args)) {
foreach ($hold_tribe_bar_args as $key => $value) {
$_REQUEST[$key] = $value;
}
}
}
开发者ID:TyRichards,项目名称:river_of_life,代码行数:38,代码来源:month.php
示例2: load_ecp_into_page_template
/**
* Loads the contents into the page template
*
* @return string Page content
*/
public static function load_ecp_into_page_template()
{
// only run once!!!
remove_filter('the_content', array(__CLASS__, 'load_ecp_into_page_template'));
self::restoreQuery();
ob_start();
echo tribe_events_before_html();
tribe_get_view();
echo tribe_events_after_html();
$contents = ob_get_contents();
ob_end_clean();
// make sure the loop ends after our template is included
if (!is_404()) {
self::endQuery();
}
return $contents;
}
开发者ID:TyRichards,项目名称:river_of_life,代码行数:22,代码来源:tribe-templates.class.php
示例3: ajax_response
/**
* AJAX handler for Week view
* This loads up the week view shard with all the appropriate events for the week
*
* @return void
*/
public function ajax_response()
{
if (isset($_POST['eventDate']) && $_POST['eventDate']) {
Tribe__Events__Query::init();
$post_status = array('publish');
if (is_user_logged_in()) {
$post_status[] = 'private';
}
$args = array('post_status' => $post_status, 'eventDate' => $_POST['eventDate'], 'eventDisplay' => 'week');
if (isset($_POST['tribe_event_category'])) {
$args[Tribe__Events__Main::TAXONOMY] = $_POST['tribe_event_category'];
}
global $wp_query;
$wp_query = Tribe__Events__Query::getEvents($args, true);
Tribe__Events__Main::instance()->setDisplay();
$response = array('html' => '', 'success' => true, 'view' => 'week');
add_filter('tribe_is_week', '__return_true');
// simplest way to declare that this is a week view
ob_start();
tribe_get_view('pro/week/content');
$response['html'] .= ob_get_clean();
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
die;
}
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:33,代码来源:Week.php
示例4: tribe_include_view_list
/**
* Include the List view
*
* Accepts an array of query arguments, retrieves them, and returns the html for those events in list view
*
* Optional inline example:
* < code >
* <?php
* echo myfunction();
* ?>
* </ code >
*
* @category Events
*
* @param array $args Args to be passed to Tribe__Events__Query::getEvents()
* @param bool $initialize Whether the list view template class needs to be included and initialized
*
* @return string
**/
function tribe_include_view_list($args = null, $initialize = true)
{
global $wp_query;
// hijack the main query to load the events via provided $args
if (!is_null($args) || !($wp_query->tribe_is_event || $wp_query->tribe_is_event_category)) {
$reset_q = $wp_query;
$wp_query = Tribe__Events__Query::getEvents($args, true);
}
// single-event notices are jumping in on this init when loading as a module
Tribe__Events__Main::removeNotice('event-past');
// get the list view template
ob_start();
if ($initialize) {
tribe_initialize_view('Tribe__Events__Template__List');
}
tribe_get_view('list/content');
$list_view_html = ob_get_clean();
// fix the error of our ways
if (!empty($reset_q)) {
$wp_query = $reset_q;
}
// return the parsed template
return $list_view_html;
}
开发者ID:TMBR,项目名称:johnjohn,代码行数:43,代码来源:general.php
示例5: ajax_response
/**
* AJAX handler for the Map view
*/
public function ajax_response()
{
$tribe_paged = !empty($_POST['tribe_paged']) ? $_POST['tribe_paged'] : 1;
Tribe__Events__Query::init();
$post_status = array('publish');
if (is_user_logged_in()) {
$post_status[] = 'private';
}
$defaults = array('post_type' => Tribe__Events__Main::POSTTYPE, 'posts_per_page' => tribe_get_option('postsPerPage', 10), 'paged' => $tribe_paged, 'post_status' => $post_status, 'eventDisplay' => 'map', 'tribe_geoloc' => true);
$view_state = 'map';
/* if past view */
if (!empty($_POST['tribe_event_display']) && $_POST['tribe_event_display'] == 'past') {
$view_state = 'past';
$defaults['eventDisplay'] = 'past';
$defaults['order'] = 'DESC';
}
if (isset($_POST['tribe_event_category'])) {
$defaults[Tribe__Events__Main::TAXONOMY] = $_POST['tribe_event_category'];
}
if (isset($_POST[Tribe__Events__Main::TAXONOMY])) {
$defaults[Tribe__Events__Main::TAXONOMY] = $_POST[Tribe__Events__Main::TAXONOMY];
}
$query = Tribe__Events__Query::getEvents($defaults, true);
$have_events = 0 < $query->found_posts;
if ($have_events && Tribe__Events__Pro__Geo_Loc::instance()->is_geoloc_query()) {
$lat = isset($_POST['tribe-bar-geoloc-lat']) ? $_POST['tribe-bar-geoloc-lat'] : 0;
$lng = isset($_POST['tribe-bar-geoloc-lng']) ? $_POST['tribe-bar-geoloc-lng'] : 0;
Tribe__Events__Pro__Geo_Loc::instance()->assign_distance_to_posts($query->posts, $lat, $lng);
} elseif (!$have_events && isset($_POST['tribe-bar-geoloc'])) {
Tribe__Notice::set_notice('event-search-no-results', sprintf(__('No results were found for events in or near <strong>"%s"</strong>.', 'tribe-events-calendar-pro'), esc_html($_POST['tribe-bar-geoloc'])));
} elseif (!$have_events && isset($_POST['tribe_event_category'])) {
Tribe__Notice::set_notice('events-not-found', sprintf(__('No matching events listed under %s. Please try viewing the full calendar for a complete list of events.', 'tribe-events-calendar-pro'), esc_html($_POST['tribe_event_category'])));
} elseif (!$have_events) {
Tribe__Notice::set_notice('event-search-no-results', __('There were no results found.', 'tribe-events-calendar-pro'));
}
$response = array('html' => '', 'markers' => array(), 'success' => true, 'tribe_paged' => $tribe_paged, 'max_pages' => $query->max_num_pages, 'total_count' => $query->found_posts, 'view' => $view_state);
// @TODO: clean this up / refactor the following conditional
if ($have_events) {
global $wp_query, $post;
$data = $query->posts;
$post = $query->posts[0];
$wp_query = $query;
Tribe__Events__Main::instance()->displaying = 'map';
ob_start();
tribe_get_view('pro/map/content');
$response['html'] .= ob_get_clean();
$response['markers'] = Tribe__Events__Pro__Geo_Loc::instance()->generate_markers($data);
} else {
global $wp_query;
$wp_query = $query;
Tribe__Events__Main::instance()->setDisplay();
ob_start();
tribe_get_view('pro/map/content');
$response['html'] .= ob_get_clean();
}
$response = apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
exit;
}
开发者ID:acutedeveloper,项目名称:havering-intranet-development,代码行数:63,代码来源:Map.php
示例6: ajax_response
/**
* List view ajax handler
*
*/
public function ajax_response()
{
Tribe__Events__Query::init();
$tribe_paged = !empty($_POST['tribe_paged']) ? intval($_POST['tribe_paged']) : 1;
$post_status = array('publish');
if (is_user_logged_in()) {
$post_status[] = 'private';
}
$args = array('eventDisplay' => 'list', 'post_type' => Tribe__Events__Main::POSTTYPE, 'post_status' => $post_status, 'paged' => $tribe_paged);
// check & set display
if (isset($_POST['tribe_event_display'])) {
if ($_POST['tribe_event_display'] == 'past') {
$args['eventDisplay'] = 'past';
$args['order'] = 'DESC';
} elseif ('all' == $_POST['tribe_event_display']) {
$args['eventDisplay'] = 'all';
}
}
// check & set event category
if (isset($_POST['tribe_event_category'])) {
$args[Tribe__Events__Main::TAXONOMY] = $_POST['tribe_event_category'];
}
$args = apply_filters('tribe_events_listview_ajax_get_event_args', $args, $_POST);
$query = tribe_get_events($args, true);
// $hash is used to detect whether the primary arguments in the query have changed (i.e. due to a filter bar request)
// if they have, we want to go back to page 1
$hash = $query->query_vars;
$hash['paged'] = null;
$hash['start_date'] = null;
$hash['end_date'] = null;
$hash_str = md5(maybe_serialize($hash));
if (!empty($_POST['hash']) && $hash_str !== $_POST['hash']) {
$tribe_paged = 1;
$args['paged'] = 1;
$query = Tribe__Events__Query::getEvents($args, true);
}
$response = array('html' => '', 'success' => true, 'max_pages' => $query->max_num_pages, 'hash' => $hash_str, 'tribe_paged' => $tribe_paged, 'total_count' => $query->found_posts, 'view' => 'list');
global $wp_query, $post, $paged;
$wp_query = $query;
if (!empty($query->posts)) {
$post = $query->posts[0];
}
$paged = $tribe_paged;
Tribe__Events__Main::instance()->displaying = apply_filters('tribe_events_listview_ajax_event_display', 'list', $args);
if (!empty($_POST['tribe_event_display']) && $_POST['tribe_event_display'] == 'past') {
$response['view'] = 'past';
}
ob_start();
tribe_get_view('list/content');
$response['html'] .= ob_get_clean();
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
die;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:59,代码来源:List.php
示例7: render_view
/**
* For default supported views, performs rendering and returns the result.
*/
public function render_view()
{
/**
* Fires before the embedded view is rendered.
*
* @param Tribe__Events__Pro__Shortcodes__Tribe_Events $shortcode
*/
do_action('tribe_events_pro_tribe_events_shortcode_pre_render', $this);
ob_start();
$this->get_template_object()->add_input_hash();
echo '<div id="tribe-events" class="' . $this->get_wrapper_classes() . '">';
// Include the tribe bar HTML if required
if ($this->is_attribute_truthy('tribe-bar', true)) {
Tribe__Events__Bar::instance()->load_script();
tribe_get_template_part('modules/bar');
}
tribe_get_view($this->get_template_object()->view_path);
echo '</div>';
$html = ob_get_clean();
/**
* Fires after the embedded view is rendered.
*
* @param Tribe__Events__Pro__Shortcodes__Tribe_Events $shortcode
*/
do_action('tribe_events_pro_tribe_events_shortcode_post_render', $this);
return $html;
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:30,代码来源:Tribe_Events.php
示例8: die
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/default-template.php
*
* @package TribeEventsCalendar
*
*/
if (!defined('ABSPATH')) {
die('-1');
}
get_header();
?>
<div id="tribe-events-pg-template">
<?php
dimox_breadcrumbs();
?>
<?php
tribe_events_before_html();
?>
<?php
tribe_get_view();
?>
<?php
tribe_events_after_html();
?>
</div> <!-- #tribe-events-pg-template -->
<?php
get_footer();
开发者ID:awheatley,项目名称:tnumc,代码行数:31,代码来源:default-template.php
示例9: ajax_tribe_geosearch
/**
* AJAX handler for the Map view
*/
function ajax_tribe_geosearch()
{
$tribe_paged = !empty($_POST["tribe_paged"]) ? $_POST["tribe_paged"] : 1;
TribeEventsQuery::init();
$defaults = array('post_type' => TribeEvents::POSTTYPE, 'orderby' => 'event_date', 'order' => 'ASC', 'posts_per_page' => tribe_get_option('postsPerPage', 10), 'paged' => $tribe_paged, 'post_status' => array('publish'), 'eventDisplay' => 'map');
$view_state = 'map';
/* if past view */
if (!empty($_POST['tribe_event_display']) && $_POST['tribe_event_display'] == 'past') {
$view_state = 'past';
}
if (isset($_POST['tribe_event_category'])) {
$defaults[TribeEvents::TAXONOMY] = $_POST['tribe_event_category'];
}
$query = TribeEventsQuery::getEvents($defaults, true);
$have_events = 0 < $query->found_posts;
if ($have_events && $this->is_geoloc_query()) {
$lat = isset($_POST['tribe-bar-geoloc-lat']) ? $_POST['tribe-bar-geoloc-lat'] : 0;
$lng = isset($_POST['tribe-bar-geoloc-lng']) ? $_POST['tribe-bar-geoloc-lng'] : 0;
$this->order_posts_by_distance($query->posts, $lat, $lng);
} elseif (!$have_events && isset($_POST['tribe-bar-geoloc'])) {
TribeEvents::setNotice('event-search-no-results', sprintf(__('No results were found for events in or near <strong>"%s"</strong>.', 'tribe-events-calendar-pro'), esc_html($_POST['tribe-bar-geoloc'])));
} elseif (!$have_events) {
TribeEvents::setNotice('event-search-no-results', __('There were no results found.', 'tribe-events-calendar-pro'));
}
$response = array('html' => '', 'markers' => array(), 'success' => true, 'tribe_paged' => $tribe_paged, 'max_pages' => $query->max_num_pages, 'total_count' => $query->found_posts, 'view' => $view_state);
if ($have_events) {
global $wp_query, $post;
$data = $query->posts;
$post = $query->posts[0];
$wp_query = $query;
TribeEvents::instance()->displaying = 'map';
ob_start();
tribe_get_view('pro/map/content');
$response['html'] .= ob_get_clean();
$response['markers'] = $this->generate_markers($data);
} else {
global $wp_query;
$wp_query = $query;
TribeEvents::instance()->setDisplay();
ob_start();
tribe_get_view('pro/map/content');
$response['html'] .= ob_get_clean();
}
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
exit;
}
开发者ID:Vinnica,项目名称:theboxerboston.com,代码行数:51,代码来源:tribe-geoloc.class.php
示例10: ajax_response
/**
* AJAX handler for Photo view
*
* @return void
*/
function ajax_response()
{
$tec = TribeEvents::instance();
TribeEventsQuery::init();
$tribe_paged = !empty($_POST['tribe_paged']) ? intval($_POST['tribe_paged']) : 1;
$args = array('eventDisplay' => 'list', 'post_type' => TribeEvents::POSTTYPE, 'post_status' => 'publish', 'paged' => $tribe_paged);
$view_state = 'photo';
if (isset($_POST['tribe_event_category'])) {
$args[TribeEvents::TAXONOMY] = $_POST['tribe_event_category'];
}
/* if past view */
if (!empty($_POST['tribe_event_display']) && $_POST['tribe_event_display'] == 'past') {
$view_state = 'past';
$args['eventDisplay'] = 'past';
}
$query = TribeEventsQuery::getEvents($args, true);
$hash = $query->query_vars;
$hash['paged'] = null;
$hash['start_date'] = null;
$hash_str = md5(maybe_serialize($hash));
if (!empty($_POST['hash']) && $hash_str !== $_POST['hash']) {
$tribe_paged = 1;
$args['paged'] = 1;
$query = TribeEventsQuery::getEvents($args, true);
}
$response = array('html' => '', 'success' => true, 'max_pages' => $query->max_num_pages, 'hash' => $hash_str, 'tribe_paged' => $tribe_paged, 'view' => $view_state);
global $wp_query, $post;
$wp_query = $query;
if (!empty($query->posts)) {
$post = $query->posts[0];
}
add_filter('tribe_events_list_pagination', array('TribeEvents', 'clear_module_pagination'), 10);
$tec->displaying = 'photo';
ob_start();
tribe_get_view('pro/photo/content');
$response['html'] .= ob_get_clean();
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
die;
}
开发者ID:TMBR,项目名称:johnjohn,代码行数:46,代码来源:photo.php
示例11: calendar_ajax_call
/**
* The Calendar View AJAX Handler.
*
* @return void
* @since 3.0
*/
function calendar_ajax_call()
{
if (isset($_POST["eventDate"]) && $_POST["eventDate"]) {
TribeEventsQuery::init();
global $wp_query;
// set the global query var for eventDisplay
$wp_query->set('eventDisplay', 'month');
if (!empty($_REQUEST['eventDate'])) {
$wp_query->set('eventDate', $_REQUEST['eventDate']);
}
if (isset($_POST['tribe_event_category'])) {
$wp_query->set(TribeEvents::TAXONOMY, $_POST['tribe_event_category']);
}
if (class_exists('TribeEventsFilterView')) {
TribeEventsFilterView::instance()->createFilters(null, true);
}
$wp_query->tribe_is_event_query = true;
$this->setDisplay();
ob_start();
tribe_get_view('month/content');
$response = array('html' => ob_get_clean(), 'success' => true, 'view' => 'month');
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
die;
}
}
开发者ID:paarthd,项目名称:gslvpa,代码行数:33,代码来源:the-events-calendar.class.php
示例12: ajax_tribe_geosearch
/**
* AJAX handler for the Map view
*/
function ajax_tribe_geosearch()
{
if (class_exists('TribeEventsFilterView')) {
TribeEventsFilterView::instance()->createFilters(null, true);
$this->setup_geoloc_filter_in_filters();
}
$tribe_paged = !empty($_POST["tribe_paged"]) ? $_POST["tribe_paged"] : 1;
TribeEventsQuery::init();
$defaults = array('post_type' => TribeEvents::POSTTYPE, 'orderby' => 'event_date', 'order' => 'ASC', 'posts_per_page' => tribe_get_option('postsPerPage', 10), 'paged' => $tribe_paged, 'post_status' => array('publish'), 'eventDisplay' => 'map');
$view_state = 'map';
/* if past view */
if (!empty($_POST['tribe_event_display']) && $_POST['tribe_event_display'] == 'past') {
$view_state = 'past';
add_filter('tribe_events_pre_get_posts', array($this, 'set_past_events_query'));
}
$query = TribeEventsQuery::getEvents($defaults, true);
if ($this->is_geoloc_query() && $query->found_posts > 0) {
$lat = isset($_POST['tribe-bar-geoloc-lat']) ? $_POST['tribe-bar-geoloc-lat'] : 0;
$lng = isset($_POST['tribe-bar-geoloc-lng']) ? $_POST['tribe-bar-geoloc-lng'] : 0;
$this->order_posts_by_distance($query->posts, $lat, $lng);
}
$response = array('html' => '', 'markers' => array(), 'success' => true, 'tribe_paged' => $tribe_paged, 'max_pages' => $query->max_num_pages, 'total_count' => $query->found_posts, 'view' => $view_state);
if ($query->found_posts > 0) {
global $wp_query, $post;
$data = $query->posts;
$post = $query->posts[0];
$wp_query = $query;
TribeEvents::instance()->setDisplay();
ob_start();
tribe_get_view('map/content');
$response['html'] .= ob_get_clean();
$response['markers'] = $this->generate_markers($data);
} else {
global $wp_query;
$wp_query = $query;
TribeEvents::instance()->setDisplay();
ob_start();
tribe_get_view('map/content');
$response['html'] .= ob_get_clean();
}
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
exit;
}
开发者ID:TyRichards,项目名称:river_of_life,代码行数:48,代码来源:tribe-geoloc.class.php
示例13: die
* 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/widgets/mini-calendar-widget.php
*
* @package TribeEventsCalendarPro
* @since 3.0
* @author Modern Tribe Inc.
*
*/
if (!defined('ABSPATH')) {
die('-1');
}
?>
<?php
$args = tribe_events_get_mini_calendar_args();
?>
<div class="tribe-mini-calendar-wrapper">
<!-- Grid -->
<?php
tribe_show_month(array('tax_query' => $args['tax_query'], 'eventDate' => $args['eventDate']), 'widgets/mini-calendar/grid');
?>
<!-- List -->
<?php
tribe_get_view('widgets/mini-calendar/list');
?>
</div>
开发者ID:TyRichards,项目名称:river_of_life,代码行数:31,代码来源:mini-calendar-widget.php
示例14: do_calendar
/**
*
* returns the full markup for the AJAX Calendar
*
* @static
*
* @param array $args
* -----> eventDate: date What month-year to print
* count: int # of events in the list (doesn't affect the calendar).
* tax_query: array For the events list (doesn't affect the calendar).
* Same format as WP_Query tax_queries. See sample below.
*
*
* tax_query sample:
*
* array( 'relation' => 'AND',
* array( 'taxonomy' => 'tribe_events_cat',
* 'field' => 'slug',
* 'terms' => array( 'featured' ),
* array( 'taxonomy' => 'post_tag',
* 'field' => 'id',
* 'terms' => array( 103, 115, 206 ),
* 'operator' => 'NOT IN' ) ) );
*
*
*/
public function do_calendar($args = array())
{
$this->args = $args;
if (!isset($this->args['eventDate'])) {
$this->args['eventDate'] = $this->get_month();
}
// don't show the list if they set it the widget option to show 0 events in the list
if ($this->args['count'] == 0) {
$this->show_list = false;
}
// enqueue the widget js
self::styles_and_scripts();
// widget setting for count is not 0
if (!$this->show_list) {
add_filter('tribe_events_template_widgets/mini-calendar/list.php', '__return_false');
}
tribe_get_view('widgets/mini-calendar-widget');
}
开发者ID:TyRichards,项目名称:river_of_life,代码行数:44,代码来源:tribe-mini-calendar.class.php
示例15: ajax_response
/**
* AJAX handler for tribe_event_day (dayview navigation)
* This loads up the day view shard with all the appropriate events for the day
*
* @return void
*/
function ajax_response()
{
if (isset($_POST['eventDate']) && $_POST['eventDate']) {
TribeEventsQuery::init();
$states[] = 'publish';
if (0 < get_current_user_id()) {
$states[] = 'private';
}
$args = array('post_status' => $states, 'eventDate' => $_POST["eventDate"], 'eventDisplay' => 'day');
TribeEvents::instance()->displaying = 'day';
if (isset($_POST['tribe_event_category'])) {
$args[TribeEvents::TAXONOMY] = $_POST['tribe_event_category'];
}
$query = TribeEventsQuery::getEvents($args, true);
global $wp_query, $post;
$wp_query = $query;
add_filter('tribe_is_day', '__return_true');
// simplest way to declare that this is a day view
ob_start();
tribe_get_view('day/content');
$response = array('html' => ob_get_clean(), 'success' => true, 'total_count' => $query->found_posts, 'view' => 'day');
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
die;
}
}
开发者ID:chicosilva,项目名称:olharambiental,代码行数:33,代码来源:day.php
示例16: ajax_response
/**
* Month View Ajax Handler
*
* @return void
*/
function ajax_response()
{
if (isset($_POST['eventDate']) && $_POST['eventDate']) {
Tribe__Events__Query::init();
$post_status = array('publish');
if (is_user_logged_in()) {
$post_status[] = 'private';
}
// set the global query var for eventDisplay
$query_args = array('post_type' => Tribe__Events__Main::POSTTYPE, 'eventDisplay' => 'month', 'eventDate' => $_POST['eventDate'], 'post_status' => $post_status);
Tribe__Events__Main::instance()->displaying = 'month';
if (isset($_POST['tribe_event_category'])) {
$query_args['tribe_events_cat'] = $_POST['tribe_event_category'];
}
query_posts($query_args);
ob_start();
tribe_get_view('month/content');
$response = array('html' => ob_get_clean(), 'success' => true, 'view' => 'month');
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
die;
}
}
开发者ID:uoyknaht,项目名称:kc,代码行数:29,代码来源:Month.php
示例17: calendar_ajax_call
/**
* The Calendar View AJAX Handler.
*
* @return void
* @since 3.0
*/
function calendar_ajax_call()
{
if (isset($_POST["eventDate"]) && $_POST["eventDate"]) {
TribeEventsQuery::init();
// set the global query var for eventDisplay
$query_args = array('post_type' => self::POSTTYPE, 'eventDisplay' => 'month', 'eventDate' => $_POST['eventDate']);
$this->displaying = 'month';
if (isset($_POST['tribe_event_category'])) {
$query_args['tribe_events_cat'] = $_POST['tribe_event_category'];
}
query_posts($query_args);
ob_start();
tribe_get_view('month/content');
$response = array('html' => ob_get_clean(), 'success' => true, 'view' => 'month');
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
die;
}
}
开发者ID:donwea,项目名称:nhap.org,代码行数:26,代码来源:the-events-calendar.class.php
示例18: ajax_response
/**
* Month View Ajax Handler
*
*/
public function ajax_response()
{
if (isset($_POST['eventDate']) && $_POST['eventDate']) {
Tribe__Events__Query::init();
Tribe__Events__Main::instance()->displaying = 'month';
global $wp_query;
$wp_query = tribe_get_events($this->args, true);
ob_start();
tribe_get_view('month/content');
$response = array('html' => ob_get_clean(), 'success' => true, 'view' => 'month');
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
die;
}
}
开发者ID:acutedeveloper,项目名称:havering-intranet-development,代码行数:20,代码来源:Month.php
示例19: wp_ajax_tribe_event_day
/**
* AJAX handler for tribe_event_day (dayview navigation)
* This loads up the day view shard with all the appropriate events for the day
*
* @return void
* @author Timothy Wood
* @since 3.0
*/
function wp_ajax_tribe_event_day()
{
if (isset($_POST["eventDate"]) && $_POST["eventDate"]) {
if (class_exists('TribeEventsFilterView')) {
TribeEventsFilterView::instance()->createFilters(null, true);
}
TribeEventsQuery::init();
add_filter('tribe_events_pre_get_posts', array($this, 'pre_get_posts'));
$args = array('post_status' => array('publish', 'private', 'future'), 'eventDate' => $_POST["eventDate"], 'eventDisplay' => 'day');
if (isset($_POST['tribe_event_category'])) {
$args[TribeEvents::TAXONOMY] = $_POST['tribe_event_category'];
}
$query = TribeEventsQuery::getEvents($args, true);
global $wp_query, $post;
$wp_query = $query;
if (have_posts()) {
the_post();
// TODO: why is this here?
rewind_posts();
// so we don't skip the first post when rendering
}
add_filter('tribe_is_day', '__return_true');
// simplest way to declare that this is a day view
TribeEventsTemplates::getTemplateHierarchy('day', '', 'pro', $this->pluginPath);
ob_start();
tribe_get_view('day/content');
$response = array('html' => ob_get_clean(), 'success' => true, 'total_count' => $query->found_posts, 'view' => 'day');
apply_filters('tribe_events_ajax_response', $response);
header('Content-type: application/json');
echo json_encode($response);
die;
}
}
开发者ID:TyRichards,项目名称:river_of_life,代码行数:41,代码来源:events-calendar-pro.php
注:本文中的tribe_get_view函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论