rest_pre_echo_response WordPress Filter Hook
The rest_pre_echo_response hook is called before the JSON response is echoed for a REST request. This hook allows you to filter the response data before it is sent back to the caller.
apply_filters( 'rest_pre_echo_response', array $result , WP_REST_Server $server , WP_REST_Request $request ) #
Filters the REST API response.
Description
Allows modification of the response data after inserting embedded data (if any) and before echoing the response data.
Parameters
- $result
(array)Response data to send to the client.
- $server
(WP_REST_Server)Server instance.
- $request
(WP_REST_Request)Request used to generate the response.
Source
Changelog
Version | Description |
---|---|
4.8.1 | Introduced. |