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.php

    r42745 r42761  
    192192        if ( ! WP_Filesystem( $credentials, $directories[0], $allow_relaxed_file_ownership ) ) {
    193193            $error = true;
    194             if ( is_object( $wp_filesystem ) && $wp_filesystem->errors->get_error_code() ) {
     194            if ( is_object( $wp_filesystem ) && $wp_filesystem->errors->has_errors() ) {
    195195                $error = $wp_filesystem->errors;
    196196            }
     
    204204        }
    205205
    206         if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {
     206        if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
    207207            return new WP_Error( 'fs_error', $this->strings['fs_error'], $wp_filesystem->errors );
    208208        }
Note: See TracChangeset for help on using the changeset viewer.