API / Minn\Rest / NavigationController

NavigationController final readonly class

Minn\Rest\NavigationController · public/minn/src/Minn/Rest/NavigationController.php · 48 lines

wp/v2/navigation: the block theme's navigation menus, stored as wp_navigation posts. The reading and writing is the posts machinery with this type's own capabilities (every one of them edit_theme_options), so only the routes live here.

Used by 1

Constants and properties

privateTYPE = 'wp_navigation'
privateBASE = 'navigation'
privatereadonly Minn\Rest\PostsController $reads

Promoted from the constructor.

privatereadonly Minn\Rest\PostsWriteController $writes

Promoted from the constructor.

Public

new__construct(Minn\Rest\PostsController $reads, Minn\Rest\PostsWriteController $writes)#
methodlist(Minn\Http\Request $request): Minn\Http\ResponseGET /wp/v2/navigation (public)#

The navigation posts.

methodsingle(Minn\Http\Request $request, string $id): Minn\Http\ResponseGET /wp/v2/navigation/{id:[\d]+} (public; navigation {id} must exist)#

One navigation post.

methodcreate(Minn\Http\Request $request): Minn\Http\ResponsePOST /wp/v2/navigation#

Creates a navigation post.

methodupdate(Minn\Http\Request $request, string $id): Minn\Http\ResponsePOST /wp/v2/navigation/{id:[\d]+} (cap edit_post on {id}; navigation {id} must exist)PUT /wp/v2/navigation/{id:[\d]+} (cap edit_post on {id}; navigation {id} must exist)PATCH /wp/v2/navigation/{id:[\d]+} (cap edit_post on {id}; navigation {id} must exist)#

Updates a navigation post.

methoddelete(Minn\Http\Request $request, string $id): Minn\Http\ResponseDELETE /wp/v2/navigation/{id:[\d]+} (cap delete_post on {id}; navigation {id} must exist)#

Trashes or deletes a navigation post.