WP_REST_Font_Collections_Controller::prepare_links()protectedWP 6.5.0

Prepares links for the request.

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

Хуков нет.

Возвращает

Массив. Links for the given font collection.

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

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

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

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

Код WP_REST_Font_Collections_Controller::prepare_links() WP 6.7.1

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