WordPress at Your Fingertips
function is not described

WP_REST_Themes_Controller::prepare_links() protected WP 5.7.0

Prepares links for the request.

{} It's a method of the class: WP_REST_Themes_Controller{}

No Hooks.

Return

Array. Links for the given block type.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_links( $theme );
$theme(WP_Theme) (required)
Theme data.

Changelog

Since 5.7.0 Introduced.

Code of WP_REST_Themes_Controller::prepare_links() WP 5.7.2

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