Advertisement
Beee

conditional placeholder registration start

Mar 5th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. // condtional placeholder if bookings are enabled and bookings start date is not yet
  2. function my_em_regstart_bookings($replacement, $condition, $match, $EM_Event) {
  3.     if( is_object($EM_Event) && preg_match('/^awaiting_regstart$/',$condition, $matches) ) {
  4.             if ( $this->event_rsvp && $this->ticket_start > current_time('timestamp') ) {
  5.         $replacement = '';
  6.       } else {
  7.         $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
  8.             }
  9.     }
  10.     return $replacement;
  11. }
  12. add_action('em_event_output_condition', 'my_em_regstart_bookings', 1, 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement