Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Currently there is no way to access Menu
This will be required for the enhanced version of the Block placeholder for new Nav Menu Block where you need the option to select from an existing WP Menu. See here for more context.
Describe the solution you'd like
Describe alternatives you've considered
I'd be interested to learn:
If possible it would be great if you could update this Issue with the status? I would do this myself but I can't easily attend the 18:00 UTC meeting time.
Very much appreciated.
I am also work on the REST API team and I worked on the feature plugin WP-API/menus-endpoints. We have working on / discussing this plugin over 6 months in the REST API core chats in slack. This api was written as a plugin, so that other could test it and once ready, it could become a core patch and end up in WP core.
What would really help is if you can install the plugin and play around with it. We need to answer these questions.
Is the data in a workable format for requirements?
Once have confirmed this and a need for this API in core, we can start adding polish and unit tests and get it merged in :D
@spacedmonkey first, great work!
Second, what is the exact status of the plugin in terms of available data? Are all the endpoints in the plugin's readme file available or is it work in progress?
Third, about the need in core:
a) the navigation block needs to be able to copy existing site menus and transform them into navigation blocks. For that alone we only need reading the available menus and the data of each available menu, by Id.
b) since the block menus are stored like any other block in the post_content, I do not think we need create/update functionality. At least not at this point.
For the last point there is an interesting talk to have about the future of the current WordPress menus as a whole: are they still needed when full site editing arrives? If yes, what for? But We should do that in a separate issue that I am still writing on, slowly ... :P
I'm intending on installing the Plugin and developing the necessary Gutenberg functionality to create Nav Blocks from existing Menus using the new endpoints it provides. Should be a good test.
Is there any chance you could test on this branch. I just remember there a couple of notice error on the current master branch. I will work to get this merged ASAP.
As for the state of the API, we have full CRUD for menus, menu items and menu locations.
Once these are merged and we have feedback from the community / gutenberg team, we can lock down the format of the API. From there, it is a matter of final tweaks, comments and unit tests added. Then we can port the plugin to a core patch.
Your feedback and input is massively valuable here. If you have issue, do feel free to create issues on the repo.
I've started testing against this yesterday with a PR to allow Nav Block item creation from existing Menus.
Initially, I found it odd that the
Overall however, it worked
Will continue iterating on my PR to further stress test.