wp_is_rest_endpoint
Filters whether a REST endpoint request is currently being handled.
This may be a standalone REST API request, or an internal request dispatched from within a regular page load.
Использование
add_filter( 'wp_is_rest_endpoint', 'wp_kama_is_rest_endpoint_filter' ); /** * Function for `wp_is_rest_endpoint` filter-hook. * * @param bool $is_request_endpoint Whether a REST endpoint request is currently being handled. * * @return bool */ function wp_kama_is_rest_endpoint_filter( $is_request_endpoint ){ // filter... return $is_request_endpoint; }
- $is_request_endpoint(true|false)
- Whether a REST endpoint request is currently being handled.
Список изменений
С версии 6.5.0 | Введена. |
Где вызывается хук
wp_is_rest_endpoint
wp-includes/rest-api.php 3464
return (bool) apply_filters( 'wp_is_rest_endpoint', $is_rest_endpoint );