WP_REST_Font_Faces_Controller::prepare_links( WP_Post $post ): array

In this article

Prepares links for the request.

Parameters

$postWP_Postrequired
Post object.

Return

array Links for the given post.

Source

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

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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