apply_filters( ‘rest_post_dispatch’, WP_HTTP_Response $result, WP_REST_Server $server, WP_REST_Request $request )

In this article

Filters the REST API response.

Description

Allows modification of the response before returning.

Parameters

$resultWP_HTTP_Response
Result to send to the client. Usually a WP_REST_Response.
$serverWP_REST_Server
Server instance.
$requestWP_REST_Request
Request used to generate the response.

Source

$result = apply_filters( 'rest_post_dispatch', rest_ensure_response( $result ), $this, $request );

Changelog

VersionDescription
4.5.0Applied to embedded responses.
4.4.0Introduced.

User Contributed Notes

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