Users: Correct the error code in wp_insert_user() when login matches an existing email.

Move the test next to the other tests for `user_login`.

Follow-up to [55358].

See #57394.

git-svn-id: https://develop.svn.wordpress.org/trunk@55360 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2023-02-17 10:13:36 +00:00
parent 7a004e8620
commit ad78d0c932
2 changed files with 19 additions and 19 deletions
+1 -1
View File
@@ -2130,7 +2130,7 @@ function wp_insert_user( $userdata ) {
// Username must not match an existing user email.
if ( email_exists( $user_login ) ) {
return new WP_Error( 'existing_user_login_as_email', __( 'Sorry, that username is not available.' ) );
return new WP_Error( 'existing_user_email_as_login', __( 'Sorry, that username is not available.' ) );
}
/**