[wp-trac] [WordPress Trac] #40878: Adding menus route
WordPress Trac
noreply at wordpress.org
Tue Oct 24 10:01:39 UTC 2017
#40878: Adding menus route
------------------------------------+------------------------------
Reporter: dingo_bastard | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses: rest-api
------------------------------------+------------------------------
Comment (by dingo_bastard):
> This is read-only, as the locations are defined in code, not stored in
the database.
A `POST` request could be made on the same endpoint where you provide
location name, then a check could be made in the callback function that
will check if the location name is taken using
[https://developer.wordpress.org/reference/functions/get_registered_nav_menus/
get_registered_nav_menus()], and if the check passes one could register
new nav menu using
[https://developer.wordpress.org/reference/functions/register_nav_menus/
register_nav_menus()].
I can try to make a patch for this.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40878#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list