-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST API endpoint for Menu Post Types #18373
Comments
@getdave The REST API team has been working on menu endpoints in WP-API/menus-endpoints. Read endpoints are pretty solid. Writes are more a work in progress. cc @spacedmonkey. |
Thanks @TimothyBJacobs! @kadamwhite @TimothyBJacobs! Would it be possible for you to raise this in the next REST API chat in Slack? 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. |
Hi @getdave 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. |
@getdave Now that Validation is merged, can you use master on WP-API/menus-endpoints. Let me know if you need anymore support. |
Hey everyone! Now that the master branch of the In light of the above I will close this issue in order to avoid duplicate issues in different repositories. Thank you 🌮 |
Currently there is no way to access Menu
Post
data via the REST API.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
A custom API endpoint in Gutenberg which provides access to data about Menu Post Types.
Describe alternatives you've considered
Asking WP Core to add an endpoint seems unlikely.
The text was updated successfully, but these errors were encountered: