Filters the pre-calculated result of a REST API dispatch request.
Description
Allow hijacking the request before dispatching by returning a non-empty. The returned value will be used to serve the request instead.
Parameters
$resultmixed- Response to replace the requested version with. Can be anything a normal endpoint can return, or null to not hijack the request.
$serverWP_REST_Server- Server instance.
$requestWP_REST_Request- Request used to generate the response.
Source
$result = apply_filters( 'rest_pre_dispatch', null, $this, $request );
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.