Make WordPress Core


Ignore:
Timestamp:
02/27/2018 02:30:46 AM (7 years ago)
Author:
SergeyBiryukov
Message:

General: Introduce WP_Error::has_errors() method and use it where appropriate.

Props robdxw, DrewAPicture, SergeyBiryukov.
Fixes #42742.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-new.php

    r42719 r42761  
    161161        $new_user_email = wp_unslash( $_REQUEST['email'] );
    162162        $user_details   = wpmu_validate_user_signup( $_REQUEST['user_login'], $new_user_email );
    163         if ( is_wp_error( $user_details['errors'] ) && ! empty( $user_details['errors']->errors ) ) {
     163        if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) {
    164164            $add_user_errors = $user_details['errors'];
    165165        } else {
Note: See TracChangeset for help on using the changeset viewer.