Opened 3 years ago
#57440 new enhancement
Add filter to customize the "rest_availability" test URL
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 5.2 |
| Component: | Site Health | Keywords: | has-patch |
| Focuses: | administration, rest-api | Cc: |
Description
The rest_availability test checks if the post post type is editable via the wp/v2/types/post endpoint.
If ever the post post type is excluded from the REST API, this test will fail:
{
"code": "rest_cannot_read_type",
"message": "Cannot view post type.",
"data": {
"status": 401
}
}
When testing the REST API, an unexpected result was returned:
REST API Endpoint: https://example.test/wp-json/wp/v2/types/post?context=edit
REST API Response: (403) Forbidden
This scenario occurs on sites that disable the post type.
Currently, this can be resolved either by replacing the test or filtering its results.
Ideally, I believe a filter to customize the REST URL to test would be the best option.
Attachments (1)
Note: See
TracTickets for help on using
tickets.
Add filter "site_status_test_rest_availability_url" to get_test_rest_availability()