W3cubDocs

/WordPress

WP_REST_Navigation_Fallback_Controller::prepare_links( WP_Post $post ): array

Prepares the links for the request.

Parameters

$postWP_Postrequired
the Navigation Menu post object.

Return

array Links for the given request.

Source

private function prepare_links( $post ) {
	return array(
		'self' => array(
			'href'       => rest_url( rest_get_route_for_post( $post->ID ) ),
			'embeddable' => true,
		),
	);
}

Changelog

Version Description
6.3.0 Introduced.

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