WP_REST_Font_Collections_Controller::prepare_links( WP_Font_Collection $collection ): array

In this article

Prepares links for the request.

Parameters

$collectionWP_Font_Collectionrequired
Font collection data

Return

array Links for the given font collection.

Source

protected function prepare_links( $collection ) {
	return array(
		'self'       => array(
			'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $collection->slug ) ),
		),
		'collection' => array(
			'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
		),
	);
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.