WordPress at a glance
filter is not described

rest_dispatch_request filter-hook . WP 4.4.0

Filters the REST dispatch request result.

Allow plugins to override dispatching the request.

Usage

add_filter( 'rest_dispatch_request', 'filter_function_name_9700', 10, 4 );
function filter_function_name_9700( $dispatch_result, $request, $route, $handler ){
	// filter...

	return $dispatch_result;
}
$dispatch_result(true/false)
Dispatch result, will be used if not empty.
$request(WP_REST_Request)
Request used to generate the response.
$route(string)
Route matched for the request.
$handler(array)
Route handler used for the request.

Notes

  • Since 4.5.0 Added $route and $handler parameters.

Where the hook is called

WP_REST_Server::dispatch()
rest_dispatch_request
wp-includes/rest-api/class-wp-rest-server.php 930
$dispatch_result = apply_filters( 'rest_dispatch_request', null, $request, $route, $handler );

Where the hook is used (in WP core)

Does not used.