WordPress.org

Make WordPress Core

Changeset 51297


Ignore:
Timestamp:
07/01/2021 08:36:12 PM (3 months ago)
Author:
johnbillion
Message:

Docs: Fix the documentation for the $tests parameter of the site_status_tests filter.

Tests are contained within direct and async properties of this array, not directly in the array itself. This also clarifies the properties that differ between direct and async tests.

See #53399, #46573

File:
1 edited

Legend:

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

    r51066 r51297  
    23722372         *
    23732373         * The site health is determined by a set of tests based on best practices from
    2374          * both the WordPress Hosting Team, but also web standards in general.
     2374         * both the WordPress Hosting Team and web standards in general.
    23752375         *
    23762376         * Some sites may not have the same requirements, for example the automatic update
     
    23822382         *
    23832383         * @since 5.2.0
    2384          * @since 5.6.0 Added the `async_direct_test` array key.
    2385          *              Added the `skip_cron` array key.
     2384         * @since 5.6.0 Added the `async_direct_test` array key for asynchronous tests.
     2385         *              Added the `skip_cron` array key for all tests.
    23862386         *
    2387          * @param array $test_type {
    2388          *     An associative array, where the `$test_type` is either `direct` or
    2389          *     `async`, to declare if the test should run via Ajax calls after page load.
     2387         * @param array[] $tests {
     2388         *     An associative array of direct and asynchronous tests.
    23902389         *
    2391          *     @type array $identifier {
    2392          *         `$identifier` should be a unique identifier for the test that should run.
    2393          *         Plugins and themes are encouraged to prefix test identifiers with their slug
    2394          *         to avoid any collisions between tests.
     2390         *     @type array[] $direct {
     2391         *         An array of direct tests.
    23952392         *
    2396          *         @type string   $label             A friendly label for your test to identify it by.
    2397          *         @type mixed    $test              A callable to perform a direct test, or a string AJAX action
    2398          *                                           to be called to perform an async test.
    2399          *         @type boolean  $has_rest          Optional. Denote if `$test` has a REST API endpoint.
    2400          *         @type boolean  $skip_cron         Whether to skip this test when running as cron.
    2401          *         @type callable $async_direct_test A manner of directly calling the test marked as asynchronous,
    2402          *                                           as the scheduled event can not authenticate, and endpoints
    2403          *                                           may require authentication.
     2393         *         @type array ...$identifier {
     2394         *             `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to
     2395         *             prefix test identifiers with their slug to avoid collisions between tests.
     2396         *
     2397         *             @type string   $label     The friendly label to identify the test.
     2398         *             @type callable $test      The callback function that runs the test and returns its result.
     2399         *             @type bool     $skip_cron Whether to skip this test when running as cron.
     2400         *         }
     2401         *     }
     2402         *     @type array[] $async {
     2403         *         An array of asynchronous tests.
     2404         *
     2405         *         @type array ...$identifier {
     2406         *             `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to
     2407         *             prefix test identifiers with their slug to avoid collisions between tests.
     2408         *
     2409         *             @type string   $label             The friendly label to identify the test.
     2410         *             @type string   $test              An admin-ajax.php action to be called to perform the test, or
     2411         *                                               if `$has_rest` is true, a URL to a REST API endpoint to perform
     2412         *                                               the test.
     2413         *             @type bool     $has_rest          Whether the `$test` property points to a REST API endpoint.
     2414         *             @type bool     $skip_cron         Whether to skip this test when running as cron.
     2415         *             @type callable $async_direct_test A manner of directly calling the test marked as asynchronous,
     2416         *                                               as the scheduled event can not authenticate, and endpoints
     2417         *                                               may require authentication.
     2418         *         }
    24042419         *     }
    24052420         * }
Note: See TracChangeset for help on using the changeset viewer.