Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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
- function my_em_registration_errors( $errors, $sanitized_user_login, $user_email ){
- if( !is_user_logged_in() ){
- return apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
- }
- }
- //This function triggers the register_form action which allows plugins like SI Captcha to ouptut a captcha on the booking form
- function my_em_registration_form_compat(){
- //add registration hook if user isn't logged in or no-user mode isn't active
- if(!is_user_logged_in() && !get_option('dbem_bookings_registration_disable')) do_action('register_form');
- }
- add_filter('em_registration_errors', 'my_em_registration_errors', 10, 3);
- add_action('em_booking_form_footer', 'my_em_registration_form_compat', 10000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement