[wp-trac] [WordPress Trac] #40878: Adding menus route
WordPress Trac
noreply at wordpress.org
Sun Oct 22 12:37:27 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: | Focuses: rest-api
-----------------------------+------------------------------
Comment (by schlessera):
As [https://wordpress.slack.com/archives/C5UNMSU4R/p1508246833000453
discussed in Slack #core-js channel], I'm uploading my current code for
working with WordPress menus through the REST API.
The basic code works:
`menu-locations` endpoint:
This provides basic enumeration, direct access through their slug, as well
as linking and embedding the attached menus.
This is read-only, as the locations are defined in code, not stored in the
database.
[[Image(https://cl.ly/3K0t1E1e2a1p/Image%202017-10-22%20at%202.28.28%20PM.png)]]
`menus` endpoint:
Extension of the terms controller. Provides all terms functionality, with
the addition of making the linked menu items embeddable, as this would be
a common use case.
[[Image(https://cl.ly/0u3b172w1f0H/Image%202017-10-22%20at%202.31.59%20PM.png)]]
`menu-items` endpoint:
Extension of the posts controller. Provides all posts functionality, with
no customizations as of yet.
Shows the associated menu in the `'menus'` property, which can also be
queried: `menu-items/?menus=2`.
[[Image(https://cl.ly/0i0s3B2B0b11/Image%202017-10-22%20at%202.34.18%20PM.png)]]
I assume that these implementations are still missing some subtleties, so
consider this a first draft to serve as a basis for discussion.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40878#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list