[wp-trac] [WordPress Trac] #32832: Menu Customizer: Hook tracking

WordPress Trac noreply at wordpress.org
Tue Jul 28 03:19:35 UTC 2015


#32832: Menu Customizer: Hook tracking
------------------------------+-------------------------------
 Reporter:  celloexpressions  |       Owner:  celloexpressions
     Type:  task (blessed)    |      Status:  assigned
 Priority:  normal            |   Milestone:  4.3
Component:  Customize         |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  needs-patch       |     Focuses:  docs
------------------------------+-------------------------------

Comment (by westonruter):

 @valendesigns In your work on #32708, do you have a good sample plugin
 with use cases for how a menu item's controls would be extended? @imath Do
 you?

 Quickly thinking about what needs to be done here, I think there are two
 things needed at a bare minimum to allow for extensibility:

 * Extend `WP_Customize_Nav_Menu_Item_Setting::value()` to allow plugins to
 amend the normal value with additional properties, where the filter can
 draw the properties from postmeta.
 * Allow for custom fields to be inserted into
 `WP_Customize_Nav_Menu_Item_Control::content_template()`.
 * Allow custom fields to be linked to the new properties in the
 `nav_menu_item` setting value, using a similar approach to the `link`
 method, although again here we're dealing with sub-properties of a
 setting, not entire setting value itself.
 * Extend
 `WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item()` to
 amend the returned `WP_Post` object with the additional properties.
 * Extend `WP_Customize_Nav_Menu_Item_Control::sanitize()` to allow the
 amended values to be sanitized.
 * Extend `WP_Customize_Nav_Menu_Item_Setting::update()` to allow the
 amended values to be persisted (in postmeta)

 There's a big assumption/question here: can we assume that a
 `nav_menu_item` setting's properties will all be sourced from postmeta, or
 will they ever be drawn from elsewhere?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32832#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list