Hello,
I am using a 3rd party navbar menu called “QuadMenu” (https://quadmenu.com/) that integrates the login and register forms into the menu. Is it possible to have the “Restrict Email Domains” plugin work with this menu?
I configured the “Restrict Email Domains” plugin to only allow gmail.com, yahoo.com and hotmail.com but when using the QuadMenu registration form it just bypasses those limits and registers any email address.
Just wondering if there is a way to get this to work?
Sincerely,
MicHi Mic,
We don’t know about the compatibility and based on your topic we assume it is not compatible.It seems they have their own custom handler for registration. If you can ask them how can we hook into their validation process for registration, I can add the support for it.
Thank you
BrajeshThank you Mic.
I am looking forward to your reply.Regards
BrajeshHey Brajesh,
Their reply was:
“Ask your developer what kind of hook he needs and we can consider to include it. The registration function is inside this file https://pastebin.com/7QKRMRxg (link added by me) and looks like this…”
function register_user($output) { if (!check_ajax_referer('quadmenu', 'nonce', false)) { QuadMenu::send_json_error(esc_html__('Please reload page.', 'quadmenu')); } $username = sanitize_user($_POST['user']); $email = sanitize_email($_POST['mail']); $password = $_POST['pass']; if (empty($username)) { QuadMenu::send_json_error(sprintf('<div class="quadmenu-alert alert-danger">%s</div>', esc_html__('Please provide an username.', 'quadmenu'))); } if (empty($email) || !is_email($email)) { QuadMenu::send_json_error(sprintf('<div class="quadmenu-alert alert-danger">%s</div>', esc_html__('Please provide a valid email address.', 'quadmenu'))); } if (empty($password)) { QuadMenu::send_json_error(sprintf('<div class="quadmenu-alert alert-danger">%s</div>', esc_html__('Please provide a password.', 'quadmenu'))); } $userdata = array( 'user_login' => $username, 'user_pass' => $password, 'user_email' => $email, ); $user_id = wp_insert_user($userdata); if (!is_wp_error($user_id)) { $user = get_user_by('id', $user_id); if ($user) { wp_set_current_user($user_id, $user->user_login); wp_set_auth_cookie($user_id); do_action('wp_login', $user->user_login); } QuadMenu::send_json_success(sprintf('<div class="quadmenu-alert alert-success">%s</div>', esc_html__('Welcome! Your user have been created.', 'quadmenu'))); } else { QuadMenu::send_json_error(sprintf('<div class="quadmenu-alert alert-danger">%s</div>', $user_id->get_error_message())); } wp_die(); }
This request seems to be getting quite specific. I don’t know how many other people are using QuadMenu, so it might not be worth investing in. If you happen to know what kind of hook you would need I will pass it along to that developer.
Thanks for your willingness to take a look!
-Mic
Hi Mic,
Please ask them to put a like before this$user_id = wp_insert_user($userdata);
Something like
do_action( 'quadmenu_registration_validated', $userdata );
ill allow us to generate custom error before allowing registration.
Regards
BrajeshHi Mic,
Thank you.
I am looking forward to their reply. Let us hope for the bets.Regards
BrajeshHey,
They responded with:
Sorry, but we cannot add the hook yet, dev team is evaluating a different way to do it. integrated with WP functions
I appreciate your help, but I am going to mark this as resolved.
-Mic
Hi Mic,
Thank you.I hope they use the correct wp functions in future. If they do, the plugin will be automatically compatible.
Regards
Brajesh
You must be logged in to reply to this topic.