From 3d97e9a53b259af63bf1edc09ff25aa6216a23b0 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 24 Sep 2015 17:48:10 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/user.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/user.php b/src/wp-admin/includes/user.php index 2d2fc37ea2..101b9ab7c6 100644 --- a/src/wp-admin/includes/user.php +++ b/src/wp-admin/includes/user.php @@ -107,7 +107,12 @@ function edit_user( $user_id = 0 ) { /* checking that username has been typed */ if ( $user->user_login == '' ) $errors->add( 'user_login', __( 'ERROR: Please enter a username.' ) ); - + + /* checking that nickname has been typed */ + if ( $update && empty( $user->nickname ) ) { + $errors->add( 'nickname', __( 'ERROR: Please enter a nickname.' ) ); + } + /* checking the password has been typed twice */ /** * Fires before the password and confirm password fields are checked for congruity.