Gets the most appropriate fallback Navigation Menu.
Parameters
$request
WP_REST_Requestrequired- Full details about the request.
Source
public function get_item( $request ) {
$post = WP_Navigation_Fallback::get_fallback();
if ( empty( $post ) ) {
return rest_ensure_response( new WP_Error( 'no_fallback_menu', __( 'No fallback menu found.' ), array( 'status' => 404 ) ) );
}
$response = $this->prepare_item_for_response( $post, $request );
return $response;
}
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.