WP_REST_Taxonomies_Controller::prepare_links()protectedWP 6.1.0

Prepares links for the request.

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

Хуков нет.

Возвращает

Массив. Links for the given taxonomy.

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

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

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

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

Код WP_REST_Taxonomies_Controller::prepare_links() WP 6.5.2

protected function prepare_links( $taxonomy ) {
	return array(
		'collection'              => array(
			'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
		),
		'https://api.w.org/items' => array(
			'href' => rest_url( rest_get_route_for_taxonomy_items( $taxonomy->name ) ),
		),
	);
}