rest_enabled filter-hook . WP 4.4.0
Deprecated from version 4.7.0. It is no longer supported and can be removed in future releases. See rest_authentication_errors.╳
Deprecated: 4.7.0 Use the {@see 'rest_authentication_errors'} filter to
restrict access to the REST API.
Filters whether the REST API is enabled.
Usage
add_filter( 'rest_enabled', 'filter_function_name_181', 10, 3 ); function filter_function_name_181( $rest_enabled, $string, $sprintf ){ // filter... return $rest_enabled; }
- $rest_enabled(true/false)
- Whether the REST API is enabled.
Default: true - $string
- -
- $sprintf
- -
Changelog
Since 4.4.0 | Introduced. | |
Deprecated Since 4.7.0 | Use the {@see 'rest_authentication_errors'} filter to |
Where the hook is called
rest_enabled
wp-includes/rest-api/class-wp-rest-server.php 374-384
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' ) );