Make WordPress Core

Changeset 45118


Ignore:
Timestamp:
04/06/2019 03:27:33 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Site Health: Display a correct error message for a failing request in wp_version_check() test.

Props Clorith, axaak.
Fixes #46814.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php

    r45099 r45118  
    107107        $test = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );
    108108
     109        if ( is_wp_error( $test ) ) {
     110            return array(
     111                'description' => sprintf(
     112                    /* translators: %s: Name of the filter used. */
     113                    __( 'Could not confirm that the %s filter is available.' ),
     114                    '<code>wp_version_check()</code>'
     115                ),
     116                'severity'    => 'warning',
     117            );
     118        }
     119
    109120        $response = wp_remote_retrieve_body( $test );
    110121
Note: See TracChangeset for help on using the changeset viewer.