rest_index WordPress Filter Hook

The rest_index hook is used to modify the response data that is returned when an index request is made. This hook allows you to add, remove, or modify data before it is returned to the client.

apply_filters( 'rest_index', WP_REST_Response $response, WP_REST_Request $request ) #

Filters the REST API root index data.


Description

This contains the data describing the API. This includes information about supported authentication schemes, supported namespaces, routes available on the API, and a small amount of data about the site.


Top ↑

Parameters

$response

(WP_REST_Response)Response data.

$request

(WP_REST_Request)Request data.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
6.0.0Added $request parameter.
4.4.0Introduced.

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.