Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // create #_BOOKINGSEND
- function em_bookings_end($replace, $EM_Event, $result) {
- if ( $result == '#_BOOKINGSEND' ) {
- // IMPORTANT : DST OFFSET MUST BE SET
- $now = date('Y-m-d H:i:s', strtotime('+2 hours'));
- $bookingsend = "";
- $rsvp = '';
- $rsvp .= $EM_Event->event_rsvp_date;
- $rsvp .= ' ';
- $rsvp .= $EM_Event->event_rsvp_time;
- $countdownformat = date("j M Y H:i:s", strtotime($rsvp));
- $nowstring = strtotime($now);
- $endstring = strtotime($rsvp);
- if ( !empty($endstring) ) { // if end date is set
- if ( $nowstring > $endstring ) { // if end date has passed
- $replace = "Sorry, it's closed already";
- } else {
- $replace = $countdownformat;
- }
- } else { // if end date is not set
- $replace = "Registrations haven't started yet.";
- }
- }
- return $replace;
- }
- add_filter('em_event_output_placeholder','em_bookings_end', 1, 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement