WP_REST_Widget_Types_Controller::prepare_links()protectedWP 5.8.0

Prepares links for the widget type.

Метод класса: WP_REST_Widget_Types_Controller{}

Хуков нет.

Возвращает

Массив. Links for the given widget type.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->prepare_links( $widget_type );
$widget_type(массив) (обязательный)
Widget type data.

Список изменений

С версии 5.8.0 Введена.

Код WP_REST_Widget_Types_Controller::prepare_links() WP 6.5.2

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