Created
August 24, 2010 09:08
-
-
Save v9n/547241 to your computer and use it in GitHub Desktop.
This file contains 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
function userAdd($username, $password, $email) { | |
if (get_user_by_email($email)) { | |
return array('error' => 1, 'msg' => '<span>This email has already taken</span>'); | |
} | |
if (get_user_by('login', $username) || get_user_by('slug', $username)) { | |
return array('error' => 2, 'msg' => '<span>This username has already taken</span>'); | |
} | |
if (wp_create_user($username, $password, $email)) { | |
return array('error' => 0); | |
}; | |
return array('error' => 3, 'msg' => '<span>Unknow error</span>'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment