Add rest route for alt api check

This commit is contained in:
David Smith 2025-02-12 16:04:48 -06:00
parent 52a5dab046
commit bbbaa2ba56
2 changed files with 20 additions and 1 deletions

View File

@ -1397,7 +1397,7 @@ class WP_Site_Health {
}
/**
* Tests if the site can communicate with WordPress.org.
* Tests if the site can communicate with a non-default update API endpoint.
*
* @since 6.8.0
*

View File

@ -124,6 +124,25 @@ class WP_REST_Site_Health_Controller extends WP_REST_Controller {
)
);
register_rest_route(
$this->namespace,
sprintf(
'/%s/%s',
$this->rest_base,
'alt-update-api-communication'
),
array(
array(
'methods' => 'GET',
'callback' => array( $this, 'test_alt_update_api_communication' ),
'permission_callback' => function() {
return $this->validate_request_permission( 'dotorg_communication' );
},
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
register_rest_route(
$this->namespace,
sprintf(