WP_REST_Response::get_curies()publicWP 4.5.0

Retrieves the CURIEs (compact URIs) used for relations.

Method of the class: WP_REST_Response{}

Hooks from the method


Array. Compact URIs.


$WP_REST_Response = new WP_REST_Response();


Since 4.5.0 Introduced.

WP_REST_Response::get_curies() code WP 6.5.4

public function get_curies() {
	$curies = array(
			'name'      => 'wp',
			'href'      => 'https://api.w.org/{rel}',
			'templated' => true,

	 * Filters extra CURIEs available on REST API responses.
	 * 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.
	 * @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 );