wppaste
WordPress

apply_filters( 'rest_response_link_curies', array $additional )

Since
4.5.0
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 http://w.org/{rel} would transform a http://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.

Compatibility

WordPress
since 4.5.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$additionalarray
Additional CURIEs to register with the REST API.

Where this hook fires · 1

  • wp-includes/rest-api/class-wp-rest-response.php:289WP_REST_Response::get_curies()

Source code

		 * correctly, so adding new CURIEs may break backward compatibility.		 *		 * @since 4.5.0		 *		 * @param array $additional Additional CURIEs to register with the REST API.		 */		$additional = apply_filters( 'rest_response_link_curies', array() ); 		return array_merge( $curies, $additional );	}}

Changelog

Introduced in 4.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.