Make WordPress Core

Changeset 48808


Ignore:
Timestamp:
08/17/2020 02:01:04 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Site Health: Ensure that the tests returned by WP_Site_Health::get_tests() always have the required array keys: direct and async.

This avoids PHP notices if these keys were accidentally removed using the site_status_tests filter.

Props khag7, Ov3rfly, desrosj, Clorith.
Fixes #50858.

File:
1 edited

Legend:

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

    r48801 r48808  
    22082208        $tests = apply_filters( 'site_status_tests', $tests );
    22092209
     2210        // Ensure that the filtered tests contain the required array keys.
     2211        $tests = array_merge(
     2212            array(
     2213                'direct' => array(),
     2214                'async'  => array(),
     2215            ),
     2216            $tests
     2217        );
     2218
    22102219        return $tests;
    22112220    }
Note: See TracChangeset for help on using the changeset viewer.