Advertisement
BakerMan

Example of listing ticket names/prices (EDD Tickets)

Feb 6th, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <p> Tickets for this event: </p>
  2.  
  3. <ul>
  4.     <?php
  5.     $edd_tickets = TribeEDDTickets::get_instance();
  6.     $tickets = (array) $edd_tickets->get_tickets_ids( get_the_ID() );
  7.     $count = 0;
  8.  
  9.     foreach ( $tickets as $ticket_id ) {
  10.         $count++;
  11.         $ticket = $edd_tickets->get_ticket( get_the_ID(), $ticket_id );
  12.         echo "<li> $ticket->name = $ticket->price bucks </li>";
  13.     }
  14.  
  15.     if ( 0 === $count ) echo '<li> No tickets </li>';
  16.     ?>
  17. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement