rest_response_link_curies WordPress Filter Hook

The rest_response_link_curies is a WordPress hook that allows you to modify the links in the REST API response. This can be used to add your own custom links or to change the format of the links.

apply_filters( 'rest_response_link_curies', array $additional ) #

Filters extra CURIEs available on REST API responses.


Description

CURIEs allow a shortened version of URI relations. This allows a more usable form for custom relations than using the full URI. These work similarly to how XML namespaces work.

Registered CURIES need to specify a name and URI template. This will automatically transform URI relations into their shortened version. The shortened relation follows the format {name}:{rel}. {rel} in the URI template will be replaced with the {rel} part of the shortened relation.

For example, a CURIE with name example and URI template https://w.org/{rel} would transform a https://w.org/term relation into example:term.

Well-behaved clients should expand and normalize these back to their full URI relation, however some naive clients may not resolve these correctly, so adding new CURIEs may break backward compatibility.


Top ↑

Parameters

$additional

(array)Additional CURIEs to register with the REST API.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

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