It is possible to hook into wpmu_validate_user_signup
, which returns the $result
of the sign-up process. Add another check for the email domain whitelist and add an error if not allowed.
add_filter( 'wpmu_validate_user_signup', 'whitelist_registration_wpse_82859' );
function whitelist_registration_wpse_82859( $result )
{
// Test array
$whitelist = array( 'gmail.com', 'mydomain.com' );
// http://php.net/manual/en/function.explode.php
$user_name_domain = explode( '@', $result['user_email'] );
if( isset( $user_name_domain[1] ) && !in_array( $user_name_domain[1], $whitelist ) )
$result['errors']->add( 'user_email', __( 'Email domain blacklisted' ) );
return $result;
}
PS: nice trick with the fake filter wpmu_signup_user
😉
Related Posts:
- How to allow an user role to create a new user under a role which lower than his level only?
- Display user registration date
- Whats the best way to share user data across multiple WordPress websites?
- WordPress auto login after registration not working
- What the user_status column?
- Problem with Hebrew characters in username
- Remove email verification when new user register
- How to set up User email verification after Signup?
- How to let user set password on registration
- How to display custom user meta from registration in backend?
- Multi-steps WordPress registration : in 4 steps how to?
- Force users to complete their profile after they register? How to
- How do i auto approve new user?
- Copy a user from one WordPress site to another
- How to get user ID during registration and add it to a custom table
- Get user info outside WordPress
- Limit content by user registration date
- What is the best way to avoid spammers registering to my blog?
- ACF Upload Image in front-end with custom form
- How to customize wp_signon()
- How Do I Prevent Junk Account Creation?
- Can I bulk register contributors for a new blog
- New user notification doesn’t include activation link
- WordPress to use Drupal users’ credentials
- Create not-activated user in code, wordpress
- Front End Registration Form Code – Password Field Not Saving
- How can I verify users facebook ID that he provides during signup process
- Plugin for limiting user registration based on ip with expiry period?
- Restricted registrations or removing the ability to edit your password/email
- Creating user in Firebase after WordPress user registration
- Can user login details be used for other applications?
- Users managed to register on website with no register button?
- Add value in user table when user is created
- Displaying different in-page content to cliente/admin
- Should I encrypt the response that triggers an Ajax action? Is nonce sufficient?
- Can i add password field into my wp registration form?
- wordpress disable login for unverified user
- How can I attach a user to another user with user meta
- Register user when after filling contact form
- Creating user without username and password
- WordPress registration without wp-login.php and wp-admin folder, is it possible?
- Check for valid email after user inactivity?
- How to set custom avatar for users?
- Assign random (and unique) user meta upon registration
- How to add registration date and last login date to user list page
- What is correct way to change user’s email?
- Send clear password via mail
- How to programmatically read the plan text password when user register?
- Custom registration and pending approval
- Automatic Website user password generation
- Customising “user ids” and add to ‘user’ panel in the admin area
- How to hide some users to unlogged users [closed]
- Unique password to access a section site
- Make new users automatically approved
- Adding more fields to the add user page on dashboard
- Edit text of WordPress “Register” button
- User with same Mail but a different additional info(like domain)
- set automatically email address for WordPress users
- WordPress 5.8 – Hide or Remove personal fields from admin Profile page
- Can I add a unique code for each user based on the location?
- Perform multiple actions after wp_insert_user()
- Send user auto generated password on different email
- How can i display pagination in custom comment list?
- Safely changing UserID’s, re-using deleted UserID’s and automatically using deleted userID’s instead of an increment
- Single Sign On (SSO) between two WordPress websites
- Auto approve new users if their username is included in a predefined list
- Disable emails for new user registration
- Insert user register into my own user table instead of wp own user
- What is the best user experience for user to perform an action using email?
- Custom registration fields not appearing in user info
- How to restrict Admin from creating new users from Add new user screen in dashboard to only of one domain?
- Registration page as homepage
- New User ID not working in custom function with user_register hook
- Set user role on registration so can upload file to own media library area
- Disallow user registration/checkout via Hotmail/Yahoo
- Retrieve New user’s ID
- Let admin users edit member profiles from front end
- view and update form only for registered users
- Integrating Facebook Registration (and Login) on a WordPress page
- New User Registration email
- how can i inform other users about new user registration? [closed]
- Add custom input field in new user page
- MySQL query to list users who never signed in
- Wordpres password as plain text in email
- WordPress password as plain text in email
- How do I add a field on the Users profile? For example, country, age etc
- Groups of capabilities: users with multiple roles?
- Is there a way to merge two users?
- How to use tinyMCE for user “biographical info” without messing with any core file?
- How to change the order in which users are displayed in admin?
- How do I enable new account notification emails (to the administrator)?
- Memory usage for scalable usermeta queries
- User profile updates password even if not filled (Theme my login) in Firefox? [closed]
- Getting the age of a users account
- Get current logged-in user from external site
- How to display a calendar with events depending on the user?
- Insert query not working for non-logged in user
- Plugin recommendation for member management [closed]
- What techniques can a user employ to achieve a password rated “strong” in the WordPress password checker
- get Discussion setting in wordpress