WP_REST_Widget_Types_Controller::prepare_links( array $widget_type ): array

Prepares links for the widget type.


Parameters

$widget_type array Required
Widget type data.

Top ↑

Return

array Links for the given widget type.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
5.8.0 Introduced.

Top ↑

User Contributed Notes

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