Filter hook 'rest_pre_serve_request'
in WP Core File wp-includes/rest-api/class-wp-rest-server.php at line 515
Description
Filters whether the REST API request has already been served. Allow sending the request manually - by returning true, the API result will not be sent to the client.
Occurrences
Filename |
Line Number |
wp-includes/rest-api/class-wp-rest-server.php |
515 |
Parameters
Type |
Name |
Description |
bool |
$served |
Whether the request has already been served. Default false. |
WP_HTTP_Response |
$result |
Result to send to the client. Usually a `WP_REST_Response`. |
WP_REST_Request |
$request |
Request used to generate the response. |
WP_REST_Server |
$server |
Server instance. |
PHP Doc
/**
* Filters whether the REST API request has already been served.
*
* Allow sending the request manually - by returning true, the API result
* will not be sent to the client.
*
* @since 4.4.0
*
* @param bool $served Whether the request has already been served.
* Default false.
* @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`.
* @param WP_REST_Request $request Request used to generate the response.
* @param WP_REST_Server $server Server instance.
*/