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

Built from https://develop.svn.wordpress.org/trunk@51297


git-svn-id: http://core.svn.wordpress.org/trunk@50906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2021-07-01 20:37:57 +00:00
parent a54727d936
commit 00a0c0f3d5
2 changed files with 34 additions and 19 deletions

View File

@ -2371,7 +2371,7 @@ class WP_Site_Health {
* Add or modify which site status tests are run on a site. * Add or modify which site status tests are run on a site.
* *
* The site health is determined by a set of tests based on best practices from * The site health is determined by a set of tests based on best practices from
* both the WordPress Hosting Team, but also web standards in general. * both the WordPress Hosting Team and web standards in general.
* *
* Some sites may not have the same requirements, for example the automatic update * Some sites may not have the same requirements, for example the automatic update
* checks may be handled by a host, and are therefore disabled in core. * checks may be handled by a host, and are therefore disabled in core.
@ -2381,26 +2381,41 @@ class WP_Site_Health {
* to complete should run asynchronously, to avoid extended loading periods within wp-admin. * to complete should run asynchronously, to avoid extended loading periods within wp-admin.
* *
* @since 5.2.0 * @since 5.2.0
* @since 5.6.0 Added the `async_direct_test` array key. * @since 5.6.0 Added the `async_direct_test` array key for asynchronous tests.
* Added the `skip_cron` array key. * Added the `skip_cron` array key for all tests.
* *
* @param array $test_type { * @param array[] $tests {
* An associative array, where the `$test_type` is either `direct` or * An associative array of direct and asynchronous tests.
* `async`, to declare if the test should run via Ajax calls after page load.
* *
* @type array $identifier { * @type array[] $direct {
* `$identifier` should be a unique identifier for the test that should run. * An array of direct tests.
* Plugins and themes are encouraged to prefix test identifiers with their slug
* to avoid any collisions between tests.
* *
* @type string $label A friendly label for your test to identify it by. * @type array ...$identifier {
* @type mixed $test A callable to perform a direct test, or a string AJAX action * `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to
* to be called to perform an async test. * prefix test identifiers with their slug to avoid collisions between tests.
* @type boolean $has_rest Optional. Denote if `$test` has a REST API endpoint. *
* @type boolean $skip_cron Whether to skip this test when running as cron. * @type string $label The friendly label to identify the test.
* @type callable $async_direct_test A manner of directly calling the test marked as asynchronous, * @type callable $test The callback function that runs the test and returns its result.
* as the scheduled event can not authenticate, and endpoints * @type bool $skip_cron Whether to skip this test when running as cron.
* may require authentication. * }
* }
* @type array[] $async {
* An array of asynchronous tests.
*
* @type array ...$identifier {
* `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to
* prefix test identifiers with their slug to avoid collisions between tests.
*
* @type string $label The friendly label to identify the test.
* @type string $test An admin-ajax.php action to be called to perform the test, or
* if `$has_rest` is true, a URL to a REST API endpoint to perform
* the test.
* @type bool $has_rest Whether the `$test` property points to a REST API endpoint.
* @type bool $skip_cron Whether to skip this test when running as cron.
* @type callable $async_direct_test A manner of directly calling the test marked as asynchronous,
* as the scheduled event can not authenticate, and endpoints
* may require authentication.
* }
* } * }
* } * }
*/ */

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.9-alpha-51296'; $wp_version = '5.9-alpha-51297';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.