mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Site Health, REST API: Move async tests to REST API endpoints.
This provides more flexibility when writing tests and benefits from running in a front-end context which is necessary for some tests like checking that updates are supported. Additionally, this provides a more robust interface for developers who want to integrate with Site Health tests. Because the `wp/v2` endpoint is reserved for modeling core entities, site health is registered in its own `wp-site-health/v1` namespace. The existing ajax actions have been maintained for backward compatibility. Props Clorith, chrisvanpatten, afragen, pokhriyal, TimothyBlynJacobs. Fixes #48105. git-svn-id: https://develop.svn.wordpress.org/trunk@49154 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -316,6 +316,11 @@ function create_initial_rest_routes() {
|
||||
// Block Directory.
|
||||
$controller = new WP_REST_Block_Directory_Controller();
|
||||
$controller->register_routes();
|
||||
|
||||
// Site Health
|
||||
$site_health = WP_Site_Health::get_instance();
|
||||
$controller = new WP_REST_Site_Health_Controller( $site_health );
|
||||
$controller->register_routes();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user