apply_filters_deprecated( ‘rest_enabled’, bool $rest_enabled )

In this article

This hook has been deprecated. Use the {@see ‘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

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'
	)
);

Changelog

VersionDescription
4.7.0Use the 'rest_authentication_errors' filter to restrict access to the REST API.
4.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.