WP_REST_Navigation_Fallback_Controller::prepare_links()privateWP 6.3.0

Prepares the links for the request.

Method of the class: WP_REST_Navigation_Fallback_Controller{}

No Hooks.

Return

Array. Links for the given request.

Usage

// private - for code of main (parent) class only
$result = $this->prepare_links( $post );
$post(WP_Post) (required)
the Navigation Menu post object.

Changelog

Since 6.3.0 Introduced.

WP_REST_Navigation_Fallback_Controller::prepare_links() code WP 6.7.1

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