WP_REST_Themes_Controller::prepare_links( WP_Theme $theme )

Prepares links for the request.

Parameters

$theme

(WP_Theme) (Required) Theme data.

Return

(array) Links for the given block type.

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.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 ) ),
			),
		);
	}

Changelog

Version Description
5.7.0 Introduced.

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