A WordPress-centric search engine for devs and theme authors



rest_pre_serve_request ›

Since4.4.0
Deprecatedn/a
apply_filters( 'rest_pre_serve_request', false, $result, $request, $this )
Parameters: (4)
  • (bool) $served Whether the request has already been served. Default false.
    Required: Yes
  • (WP_HTTP_Response) $result Result to send to the client. Usually a WP_REST_Response.
    Required: Yes
  • (WP_REST_Request) $request Request used to generate the response.
    Required: Yes
  • (WP_REST_Server) $this Server instance.
    Required: Yes
Defined at:
Codex:

Filters whether the request has already been served.

Allow sending the request manually - by returning true, the API result will not be sent to the client.





Source

$served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this );