wpseek.com
A WordPress-centric search engine for devs and theme authors



rest_pre_serve_request › WordPress Filter Hooks

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

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.




Source

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