хук-фильтр
Устаревший since 4.4.0
rest_enabled
Устаревшее.
Помечено устаревшим с версии 4.7.0.
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
apply_filters_deprecated( 'rest_enabled', bool $rest_enabled )
Описание
Фильтрует, включён ли REST API.
Фильтруемое значение
Включён ли REST API. Значение по умолчанию true.
Параметры
$rest_enabled
bool
обязательный
Включён ли REST API. Значение по умолчанию true.
Исходный код
wp-includes/rest-api/class-wp-rest-server.php:342
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'
)
);
История изменений
| Версия | Описание |
|---|---|
| 4.7.0 | Deprecated. Use the 'rest_authentication_errors' filter to restrict access to the REST API. |
| 4.4.0 | Introduced. |

