-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add route to return rendered html of a single menu #27
base: master
Are you sure you want to change the base?
Conversation
Also made a correction to the get_menu() function the $rest_url was getting the api namespace instead of the plugin name space
Didn't test the REST API v1 version of this.
…"render_html" to "html" in the json output.
…u from the location rendered as html
…endered in html from the location for the API v1. Also changed "render_html" to "html" in the json output for API v1. Code hasn't been tested
@Underdawgq Could you explain what this does and how do you indent someone to use it? |
Instead of returning the menu as a tree these routes return the menu in html. If someone wanted to simply mirror a menu from one WordPress site to another this is much easier than setting up a loop to transform the tree into html. So if site B wanted the same menu as site A then all they would have to do is edit the theme for site B from something like this: to use something like: |
I did not test the code for v1 of the REST API.