WordPress at Your Fingertips
function is not described

WP_REST_Widget_Types_Controller::prepare_links() protected WP 5.8.0

Prepares links for the widget type.

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

No Hooks.

Return

Array. Links for the given widget type.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_links( $widget_type );
$widget_type(array) (required)
Widget type data.

Changelog

Since 5.8.0 Introduced.

Code of WP_REST_Widget_Types_Controller::prepare_links() WP 5.8.1

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'] ) ),
		),
	);
}