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/includes/class-wp-upgrader-skin.php

    r42343 r42761  
    128128        if ( is_string( $errors ) ) {
    129129            $this->feedback( $errors );
    130         } elseif ( is_wp_error( $errors ) && $errors->get_error_code() ) {
     130        } elseif ( is_wp_error( $errors ) && $errors->has_errors() ) {
    131131            foreach ( $errors->get_error_messages() as $message ) {
    132132                if ( $errors->get_error_data() && is_string( $errors->get_error_data() ) ) {
Note: See TracChangeset for help on using the changeset viewer.