Check for a WP_Error return from wp_create_user() in register_new_user().
props coffee2code. fixes #14290. git-svn-id: https://develop.svn.wordpress.org/trunk@25174 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0494df8152
commit
7e5192393a
@ -353,7 +353,7 @@ function register_new_user( $user_login, $user_email ) {
|
||||
|
||||
$user_pass = wp_generate_password( 12, false);
|
||||
$user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
|
||||
if ( ! $user_id ) {
|
||||
if ( ! $user_id || is_wp_error( $user_id ) ) {
|
||||
$errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you… please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
|
||||
return $errors;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user