[wp-trac] [WordPress Trac] #18584: Nav menus need more hooks for extensibility (on admin page & in customizer)
WordPress Trac
noreply at wordpress.org
Sat Jan 23 22:51:57 UTC 2016
#18584: Nav menus need more hooks for extensibility (on admin page & in customizer)
--------------------------+-----------------------------
Reporter: Viper007Bond | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Customize | Version: 3.3
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: javascript
--------------------------+-----------------------------
Changes (by westonruter):
* keywords: has-patch => needs-patch
Comment:
How about a filter instead of an action? See [attachment:18584.2.diff]
which adds a `wp_nav_menu_item_fields` filter for the fields that are
output both in the walker for a specific nav menu item on the nav menus
admin page and for the JS template for a nav menu item control in the
Customizer. It also introduces a `wp_nav_menu_manage_columns` filter for
manipulating which fields appear in the advanced menu properties in Screen
Options. The patch here builds upon #35273. The facility here allows
existing fields to be easily removed as well as to allow new ones to be
added.
I believe there are still missing pieces here, like hooking up the display
to toggle displaying the fields based on whether the column checkbox is
checked for any additional fields added. Also, the fields here would be
dummy fields without the corresponding PHP logic (for admin menus page) or
JS logic (for Customizer) to actually handle the rendering of the values
and persisting of the values.
This patch is a WIP. I didn't closely examine the existing patches, but I
wanted to see something that would also facilitate extending the
Customizer. Please anyone iterate on it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/18584#comment:64>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list