/** * Provides all of the recurring events for the provided date that have the same event parent * * @since 4.0.3 * * @param int $event_id Event ID * @param string $date Date to fetch recurring events from * * @return string */ public function get_recurring_events_for_date($event_id, $date) { if (!($event = tribe_events_get_event($event_id))) { return array(); } $parent_id = empty($event->post_parent) ? $event->ID : $event->post_parent; $post_status = array('publish'); if (is_user_logged_in()) { $post_status[] = 'private'; } $args = array('start_date' => tribe_beginning_of_day($date), 'end_date' => tribe_end_of_day($date), 'post_status' => $post_status, 'post_parent' => $parent_id, 'tribeHideRecurrence' => false); $events = tribe_get_events($args); return $events; }
/** * Provides all of the recurring events for the provided date that have the same event parent * * @since 4.0.3 * * @param int $event_id Event ID * @param string $date Date to fetch recurring events from * * @return string */ public function get_recurring_events_for_date($event_id, $date) { if (!($event = tribe_events_get_event($event_id))) { return array(); } $parent_id = empty($event->post_parent) ? $event->ID : $event->post_parent; $post_status = array('publish'); if (is_user_logged_in()) { $post_status[] = 'private'; } $args = array('start_date' => tribe_beginning_of_day($date), 'end_date' => tribe_end_of_day($date), 'post_status' => $post_status, 'tribeHideRecurrence' => false); // we want event times regardless of whether or not the event is a parent or a child // recurring event. We have to fetch those slightly differently depending on which // it is if (empty($event->post_parent)) { // we're looking at the master event, so grab the info via the ID $args['p'] = $parent_id; } else { // we're looking at a child event, so grab the info via post_parent $args['post_parent'] = $parent_id; } $events = tribe_get_events($args); return $events; }
/** * Returns true if the event contains one or more tickets which are not * subject to any inventory limitations. * * @param null $event * * @return bool */ function tribe_events_has_unlimited_stock_tickets($event = null) { if (null === ($event = tribe_events_get_event($event))) { return 0; } foreach (Tribe__Events__Tickets__Tickets::get_all_event_tickets($event->ID) as $ticket) { if (Tribe__Events__Tickets__Ticket_Object::UNLIMITED_STOCK === $ticket->stock) { return true; } } return false; }
* Single Event Template * A single event. This displays the event title, description, meta, and * optionally, the Google map for the event. * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php * * @package TribeEventsCalendar * */ if (!defined('ABSPATH')) { die('-1'); } $events_label_singular = 'Service'; $events_label_plural = 'Services'; $event_id = get_the_ID(); $event = tribe_events_get_event(); //var_dump($event_id) ?> <div id="tribe-events-content" class="tribe-events-single vevent hentry"> <h2 class="title-services">Services</h2> <div class="content-event"> <?php ?> <div class="main-description field"> Upcomming Service for:<br> <?php the_title(); ?>
function get_single_event_callback() { if (!isset($_POST['event_id'])) { echo 'no event id provided'; die; } $event = tribe_events_get_event($_POST['event_id']); ob_start(); include_once '_partial-single-event.php'; $html = ob_get_contents(); ob_end_clean(); $result = array('status' => 'success', 'html' => $html); echo json_encode($result); exit(1); }