WP-API / widgets-endpoints

Experimental WordPress REST API Widgets endpoints.
7 stars 1 forks source link

Aligning interfaces for widgets and nav menus #2

Open westonruter opened 8 years ago

westonruter commented 8 years ago

Widgets and nav menus are very similar in how they are structured in that both consist of collections of items which can be ordered. Indeed, nav menus could be entirely removed from core and in their place widgets could be used to build out navigation, with a “nav menu item” widget that has all the properties of a nav menu item. Nevertheless, there are some big differences in how widgets and nav menus are represented in the WP DB and as such there are certain restrictions on how they can be manipulated, but it would be great to align the REST APIs to reduce the cognitive load by harmonizing the interfaces.

Current: Nav Menus

danielbachhuber commented 8 years ago

Great writeup, Weston :+1:

westonruter commented 8 years ago

Added points contrasting how widget instances and nav menu items are identified, with widgets being addressed in a similar way to terms prior to term splitting. Opened core ticket to harmonize by storing widgets in custom post type: https://core.trac.wordpress.org/ticket/35669