Exemple #1
0
 /**
  * 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;
     }
     Tribe__Events__Tickets__Tickets_Pro::instance()->do_meta_box($post_id);
 }
 /**
  * Static Singleton Factory Method
  *
  * @return Tribe__Events__Tickets__Tickets_Pro
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         $className = __CLASS__;
         self::$instance = new $className();
     }
     return self::$instance;
 }
Exemple #3
0
 /**
  *  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);
     // Successfully deleted?
     if ($return) {
         // Let's create a tickets list markup to return
         $tickets = $this->get_event_tickets($post_id);
         $return = Tribe__Events__Tickets__Tickets_Pro::instance()->get_ticket_list_markup($tickets);
         $return = $this->notice(__('Your ticket has been deleted.', 'the-events-calendar')) . $return;
         // Additionally ensure the event costs meta data is updated accordingly
         Tribe__Events__API::update_event_cost($post_id);
     }
     $this->ajax_ok($return);
 }
Exemple #4
0
		<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 = Tribe__Events__Tickets__Tickets_Pro::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_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);