/** * Loads the content of the tickets metabox if there's at * least one Tribe Tickets module (provider) enabled * @static * * @param $post_id */ public static function do_modules_metaboxes($post_id) { $modules = apply_filters('tribe_events_tickets_modules', NULL); if (empty($modules)) { return; } TribeEventsTicketsPro::instance()->do_meta_box($post_id); }
/** * Sanitizes the data for the delete ticket ajax call, * and calls the child delete_ticket function. */ public final function ajax_handler_ticket_delete() { if (!isset($_POST["post_ID"])) { $this->ajax_error('Bad post'); } if (!isset($_POST["ticket_id"])) { $this->ajax_error('Bad post'); } if (empty($_POST["nonce"]) || !wp_verify_nonce($_POST["nonce"], 'remove_ticket_nonce') || !current_user_can('edit_tribe_events')) { $this->ajax_error("Cheatin' huh?"); } $post_id = $_POST["post_ID"]; $ticket_id = $_POST["ticket_id"]; // Pass the control to the child object $return = $this->delete_ticket($post_id, $ticket_id); // If deleted OK, let's create a tickets list markup to return if ($return) { $tickets = $this->get_event_tickets($post_id); $return = TribeEventsTicketsPro::instance()->get_ticket_list_markup($tickets); $return = $this->notice(__('Your ticket has been deleted.', 'tribe-events-calendar')) . $return; } $this->ajax_ok($return); }
/** * Static Singleton Factory Method * @return TribeEventsTicketsPro */ public static function instance() { if (!isset(self::$instance)) { $className = __CLASS__; self::$instance = new $className(); } return self::$instance; }
<center> <?php do_action('tribe_tickets_ticket_email_top'); ?> <?php $count = 0; $break = ""; foreach ($tickets as $ticket) { $count++; if ($count == 2) { $break = "page-break-before: always !important;"; } $event = get_post($ticket["event_id"]); $header_id = TribeEventsTicketsPro::instance()->get_header_image_id($ticket['event_id']); $header_img = false; if (!empty($header_id)) { $header_img = wp_get_attachment_image_src($header_id, 'full'); } $venue_id = tribe_get_venue_id($event->ID); if (!empty($venue_id)) { $venue = get_post($venue_id); } $venue_name = $venue_phone = $venue_address = $venue_city = $venue_email = $venue_web = ''; if (!empty($venue)) { $venue_name = $venue->post_title; $venue_phone = get_post_meta($venue_id, '_VenuePhone', true); $venue_address = get_post_meta($venue_id, '_VenueAddress', true); $venue_city = get_post_meta($venue_id, '_VenueCity', true); $venue_web = get_post_meta($venue_id, '_VenueURL', true);