Add email and login dupe checking down into wp_insert_user(). Tidy up user-new.php. see #11644

git-svn-id: https://develop.svn.wordpress.org/trunk@12778 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-01-20 21:58:13 +00:00
parent 40b69eb90c
commit d6ea7c7bde
5 changed files with 27 additions and 33 deletions
+3 -6
View File
@@ -1222,14 +1222,11 @@ function wpmu_activate_signup($key) {
function wpmu_create_user( $user_name, $password, $email) {
$user_name = preg_replace( "/\s+/", '', sanitize_user( $user_name, true ) );
if ( username_exists($user_name) )
return false;
// Check if the email address has been used already.
if ( email_exists($email) )
return false;
$user_id = wp_create_user( $user_name, $password, $email );
if ( is_wp_error($user_id) )
return false;
$user = new WP_User($user_id);
// Newly created users have no roles or caps until they are added to a blog.