rest_namespace_index WordPress Filter Hook

The rest_namespace_index hook allows you to add or remove data from the WordPress REST API response for the index of a namespace.

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

Filters the REST API namespace index data.


Description

This typically is just the route data for the namespace, but you can add any data you’d like here.


Top ↑

Parameters

$response

(WP_REST_Response)Response data.

$request

(WP_REST_Request)Request data. The namespace is passed as the 'namespace' parameter.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
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.