General: Introduce WP_Error::has_errors() method and use it where appropriate.
Props robdxw, DrewAPicture, SergeyBiryukov. Fixes #42742. Built from https://develop.svn.wordpress.org/trunk@42761 git-svn-id: http://core.svn.wordpress.org/trunk@42591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -44,7 +44,7 @@ if ( isset( $_REQUEST['action'] ) && 'add-user' == $_REQUEST['action'] ) {
|
||||
$user = wp_unslash( $_POST['user'] );
|
||||
|
||||
$user_details = wpmu_validate_user_signup( $user['username'], $user['email'] );
|
||||
if ( is_wp_error( $user_details['errors'] ) && ! empty( $user_details['errors']->errors ) ) {
|
||||
if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) {
|
||||
$add_user_errors = $user_details['errors'];
|
||||
} else {
|
||||
$password = wp_generate_password( 12, false );
|
||||
|
||||
Reference in New Issue
Block a user