Advertisement
Beee

cust plh bookingsstart

Mar 25th, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?
  2. // create #_BOOKINGSSTART
  3. function em_bookings_start($replace, $EM_Event, $result) {
  4.   if ( $result == '#_BOOKINGSSTART' ) {
  5.         global $EM_Event;
  6.         $is_open = $EM_Event->get_bookings()->is_open(); // whether there are any available tickets right now
  7.     if ( $is_open ) {
  8.         $regstatus = 'Now open';
  9.     } else {
  10.  
  11.         $bookingsstart = "";
  12.         foreach( $EM_Event->get_tickets()->tickets as $EM_Ticket ) {
  13.           $bookingsstart .= $EM_Ticket->ticket_start;
  14.         }
  15.         $newdateformat  = date("d M Y H:i:s", strtotime($bookingsstart));
  16.  
  17.             global $post;
  18.             $countdown = get_post_meta($EM_Event->ID, 'Registration starts', true);
  19.             if (strpos($countdown, 'ferg' ) !== false) {
  20.             $regstatus = do_shortcode('[fergcorp_cdt_single date="'.$newdateformat.' CET"]');
  21.             } else {
  22.             $regstatus = "t.b.a.";
  23.             }
  24.     }
  25.     $replace = $regstatus;
  26.   }
  27.   return $replace;
  28. }
  29. add_filter('em_event_output_placeholder','em_bookings_start', 1, 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement