Advertisement
supportnwl

Editable default ticket

Dec 18th, 2012
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. function my_em_add_default_tickets($tickets,$EM_Bookings){
  2. if ( empty($tickets->event_id) ){
  3. $ticket_data = array();
  4. $ticket_data[0] = array('ticket_name'=>'General 1','ticket_description'=>'detail 1','ticket_spaces'=>5);
  5. $ticket_data[1] = array('ticket_name'=>'General 2','ticket_description'=>'detail 2','ticket_spaces'=>10);
  6. $ticket_data[2] = array('ticket_name'=>'General 3','ticket_description'=>'detail 3','ticket_spaces'=>15);
  7. if ( is_array($tickets->tickets) )unset($tickets->tickets);
  8. foreach ($ticket_data as $ticket){
  9. $EM_Ticket = new EM_Ticket($ticket);
  10. $tickets->tickets[] = $EM_Ticket;
  11. }
  12. }
  13. return $tickets;
  14. }
  15. add_filter('em_bookings_get_tickets','my_em_add_default_tickets',10,2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement