WP_REST_Template_Revisions_Controller::prepare_links( WP_Block_Template $template ): array

In this article

Prepares links for the request.

Parameters

$templateWP_Block_Templaterequired
Template.

Return

array Links for the given post.

Source

protected function prepare_links( $template ) {
	$links = array(
		'self'   => array(
			'href' => rest_url( sprintf( '/%s/%s/%s/%s/%d', $this->namespace, $this->parent_base, $template->id, $this->rest_base, $template->wp_id ) ),
		),
		'parent' => array(
			'href' => rest_url( sprintf( '/%s/%s/%s', $this->namespace, $this->parent_base, $template->id ) ),
		),
	);

	return $links;
}

Changelog

VersionDescription
6.4.0Introduced.

User Contributed Notes

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