On this page
apply_filters_deprecated( 'rest_enabled', bool $rest_enabled )
This hook has been deprecated. Use the ‘rest_authentication_errors’ filter to restrict access to the REST API instead.
Filters whether the REST API is enabled.
Parameters
$rest_enabledbool-
Whether the REST API is enabled. Default true.
Source
File: wp-includes/rest-api/class-wp-rest-server.php. View all references
apply_filters_deprecated(
'rest_enabled',
array( true ),
'4.7.0',
'rest_authentication_errors',
sprintf(
/* translators: %s: rest_authentication_errors */
__( 'The REST API can no longer be completely disabled, the %s filter can be used to restrict access to the API, instead.' ),
'rest_authentication_errors'
)
);
Related
Used By
| Used By | Description |
|---|---|
| WP_REST_Server::serve_request() wp-includes/rest-api/class-wp-rest-server.php | Handles serving a REST API request. |
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Use the 'rest_authentication_errors' filter to restrict access to the REST API. |
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_enabled