A WordPress-centric search engine for devs and theme authors

rest_pre_dispatch ›

apply_filters( 'rest_pre_dispatch', null, $this, $request )
Parameters: (3)
  • (mixed) $result Response to replace the requested version with. Can be anything a normal endpoint can return, or null to not hijack the request.
    Required: Yes
  • (WP_REST_Server) $this Server instance.
    Required: Yes
  • (WP_REST_Request) $request Request used to generate the response.
    Required: Yes
Defined at:

Filters the pre-calculated result of a REST dispatch request.

Allow hijacking the request before dispatching by returning a non-empty. The returned value will be used to serve the request instead.


$result = apply_filters( 'rest_pre_dispatch', null, $this, $request );