WP_REST_Widget_Types_Controller::prepare_links( array $widget_type ): array

In this article

Prepares links for the widget type.

Parameters

$widget_typearrayrequired
Widget type data.

Return

array Links for the given widget type.

Source

protected function prepare_links( $widget_type ) {
	return array(
		'collection' => array(
			'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
		),
		'self'       => array(
			'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $widget_type['id'] ) ),
		),
	);
}

Changelog

VersionDescription
5.8.0Introduced.

User Contributed Notes

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