WP_REST_Font_Faces_Controller::prepare_links()protectedWP 6.5.0

Prepares links for the request.

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

Хуков нет.

Возвращает

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

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

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

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

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

Код WP_REST_Font_Faces_Controller::prepare_links() WP 6.7.1

protected function prepare_links( $post ) {
	// Entity meta.
	return array(
		'self'       => array(
			'href' => rest_url( $this->namespace . '/font-families/' . $post->post_parent . '/font-faces/' . $post->ID ),
		),
		'collection' => array(
			'href' => rest_url( $this->namespace . '/font-families/' . $post->post_parent . '/font-faces' ),
		),
		'parent'     => array(
			'href' => rest_url( $this->namespace . '/font-families/' . $post->post_parent ),
		),
	);
}