apply_filters( ‘rest_dispatch_request’, mixed $dispatch_result, WP_REST_Request $request, string $route, array $handler )

In this article

Filters the REST API dispatch request result.

Description

Allow plugins to override dispatching the request.

Parameters

$dispatch_resultmixed
Dispatch result, will be used if not empty.
$requestWP_REST_Request
Request used to generate the response.
$routestring
Route matched for the request.
$handlerarray
Route handler used for the request.

Source

$dispatch_result = apply_filters( 'rest_dispatch_request', null, $request, $route, $handler );

Changelog

VersionDescription
4.5.0Added $route and $handler parameters.
4.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.