WP_REST_Font_Collections_Controller::prepare_links()protectedWP 6.5.0

Prepares links for the request.

Method of the class: WP_REST_Font_Collections_Controller{}

No Hooks.

Return

Array. Links for the given font collection.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_links( $collection );
$collection(WP_Font_Collection) (required)
Font collection data

Changelog

Since 6.5.0 Introduced.

WP_REST_Font_Collections_Controller::prepare_links() code WP 6.7.1

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 ) ),
		),
	);
}