Last active
October 25, 2018 01:50
-
-
Save ultimatemember/5f093ac300baa1d2a5f1 to your computer and use it in GitHub Desktop.
Example: block any registration that does not use @gmail as mail provider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The following code will require @gmail.com as domain | |
for user registrations. | |
You can change @gmail.com to any provider you want. | |
The code below requires a user email to be collected during registration | |
*/ | |
add_action('um_before_new_user_register', 'require_google_email_for_signup'); | |
function require_google_email_for_signup( $args ) { | |
extract($args); | |
if ( !strstr( $user_email, '@gmail.com' ) ) | |
exit( wp_redirect( add_query_arg('err', 'you_must_have_googlemail') ) ); | |
} |
‘um_before_new_user_register’ has been depreciated, is it possible to ha ave an update version?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @jackmoody11 - were you ever able to figure this out? I have the same questions when I'm trying to restrict to only a specific top level domain.