Advertisement
eventsmanager

Booking/Registration form integration with other plugins

Aug 14th, 2013
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. //This function passes the custom em_registration_errors filter to the original registration_errors filter which allows plugins like SI Captcha to work with booking forms
  2. function my_em_registration_errors( $errors, $sanitized_user_login, $user_email ){
  3.     if( !is_user_logged_in() ){
  4.         return apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
  5.     }
  6. }
  7.  
  8. //This function triggers the register_form action which allows plugins like SI Captcha to ouptut a captcha on the booking form
  9. function my_em_registration_form_compat(){
  10.     //add registration hook if user isn't logged in or no-user mode isn't active
  11.     if(!is_user_logged_in() && !get_option('dbem_bookings_registration_disable')) do_action('register_form');
  12. }
  13.  
  14. add_filter('em_registration_errors', 'my_em_registration_errors', 10, 3);
  15. add_action('em_booking_form_footer', 'my_em_registration_form_compat', 10000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement