W3cubDocs

/WordPress

apply_filters( 'rest_post_dispatch', WP_HTTP_Response $result, WP_REST_Server $this, WP_REST_Request $request )

Filters the API response.

Description

Allows modification of the response before returning.

Parameters

$result

(WP_HTTP_Response) Result to send to the client. Usually a WP_REST_Response.

$this

(WP_REST_Server) Server instance.

$request

(WP_REST_Request) Request used to generate the response.

Source

File: wp-includes/rest-api/class-wp-rest-server.php

View on Trac

Changelog

Version Description
4.5.0 Applied to embedded responses.
4.4.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_post_dispatch