W3cubDocs

/WordPress

WP_REST_Font_Collections_Controller::prepare_links( WP_Font_Collection $collection ): array

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

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_font_collections_controller/prepare_links