Warning: This hook has been deprecated. Use the ‘rest_authentication_errors’ filter to restrict access to the REST API instead.

rest_enabled WordPress Hook

The rest_enabled hook is a WordPress hook that allows you to enable or disable the REST API for a specific user. This hook is useful if you want to disable the REST API for a specific user or if you want to enable the REST API for a specific user.

apply_filters_deprecated( 'rest_enabled', bool $rest_enabled ) #

Filters whether the REST API is enabled.


Parameters

$rest_enabled

(bool)Whether the REST API is enabled. Default true.


Top ↑

Source

File: wp-includes/rest-api/class-wp-rest-server.php

View on Trac



Top ↑

Changelog

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

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.