eventsmanager

Force users to log out when booking

Sep 26th, 2013
153
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * Force users to log out before booking
  4.  * @param boolean $result
  5.  * @param EM_Booking $EM_Booking
  6.  * @return boolean
  7.  */
  8. function my_em_booking_force_guests($result, $EM_Booking){
  9.     if( is_user_logged_in() ){
  10.         $EM_Booking->add_error('Please log out to make a booking.');
  11.         return false;
  12.     }
  13.     return $result;
  14. }
  15. add_filter('em_booking_validate','my_em_booking_force_guests', 1, 2);
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×