WP_REST_Navigation_Fallback_Controller::prepare_links
Prepares the links for the request.
Method of the class: WP_REST_Navigation_Fallback_Controller{}
No Hooks.
Returns
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() WP REST Navigation Fallback Controller::prepare links code WP 6.9
private function prepare_links( $post ) {
return array(
'self' => array(
'href' => rest_url( rest_get_route_for_post( $post->ID ) ),
'embeddable' => true,
),
);
}