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.


Top ↑

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.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.8.1Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.