W3cubDocs

/WordPress

WP_REST_Font_Faces_Controller::prepare_links( WP_Post $post ): array

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

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_font_faces_controller/prepare_links