Correctly present an error to the user if the nickname field is empty when updating a user profile. It's strange that this field is required, but it is, so be it.

Fixes #33310
Props prasad-nevase, metodiew


git-svn-id: https://develop.svn.wordpress.org/trunk@34505 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2015-09-24 17:48:10 +00:00
parent 821821c8b5
commit 3d97e9a53b

View File

@ -108,6 +108,11 @@ function edit_user( $user_id = 0 ) {
if ( $user->user_login == '' )
$errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ) );
/* checking that nickname has been typed */
if ( $update && empty( $user->nickname ) ) {
$errors->add( 'nickname', __( '<strong>ERROR</strong>: Please enter a nickname.' ) );
}
/* checking the password has been typed twice */
/**
* Fires before the password and confirm password fields are checked for congruity.