WordPress at a glance
filter is not described

rest_enabled filter-hook . WP 4.4.0

Deprecated in 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 API.

Filters whether the REST API is enabled.

Usage

add_filter( 'rest_enabled', 'filter_function_name_9632', 10, 4 );
function filter_function_name_9632( $rest_enabled, $string, $string, $sprintf ){
	// filter...

	return $rest_enabled;
}
$rest_enabled(true/false)
Whether the REST API is enabled.
Default: true
$string
-
$string
-
$sprintf
-

Changelog

Since 4.4.0 Introduced.
Deprecated Since 4.7.0 Use the {@see 'rest_authentication_errors'} filter to

restrict access to the API.

Where the hook is called

WP_REST_Server::serve_request()
rest_enabled
wp-includes/rest-api/class-wp-rest-server.php 310-320
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'
	)
);

Where in WP core the hook is used WordPress

Usage not found.