rest_endpoints WordPress Filter Hook

The rest_endpoints hook allows you to modify the data that is returned by the WordPress REST API. This can be useful for adding or removing data from the API response, or for changing the structure of the data that is returned.

apply_filters( 'rest_endpoints', array $endpoints ) #

Filters the array of available REST API endpoints.


Parameters

$endpoints

(array)The available endpoints. An array of matching regex patterns, each mapped to an array of callbacks for the endpoint. These take the format '/path/regex' => array( $callback, $bitmask ) or `'/path/regex' => array( array( $callback, $bitmask ).


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.