Filters whether the REST API request has already been served.
Description
Allow sending the request manually – by returning true, the API result will not be sent to the client.
Parameters
$served
bool- Whether the request has already been served.
Default false. $result
WP_HTTP_Response- Result to send to the client. Usually a
WP_REST_Response
. $request
WP_REST_Request- Request used to generate the response.
$server
WP_REST_Server- Server instance.
Source
$served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this );
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.