Filters the pre-calculated result of a REST API dispatch request.
$resultmixed$serverWP_REST_Server$requestWP_REST_Requestwp-includes/rest-api/class-wp-rest-server.php:1084WP_REST_Server::dispatch()wp-includes/rest-api/class-wp-rest-server.php:1845WP_REST_Server::serve_batch_request_v1() * * @param mixed $result Response to replace the requested version with. Can be anything * a normal endpoint can return, or null to not hijack the request. * @param WP_REST_Server $server Server instance. * @param WP_REST_Request $request Request used to generate the response. */ $result = apply_filters( 'rest_pre_dispatch', null, $this, $request ); if ( ! empty( $result ) ) { // Normalize to either WP_Error or WP_REST_Response... $result = rest_ensure_response( $result );Introduced in 4.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.