@gmail and @yahoo only
-
i found this solution on the documentation forum.
i want to ask 2 things:1. In which .php file should i include this code?
2. How to extend it to include @yahoo.com too? In other words, how to block every other mail domains except @gmail and @yahoo?Please help.
/*
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’) ) );
}
- The topic ‘@gmail and @yahoo only’ is closed to new replies.