[wp-trac] [WordPress Trac] #47056: Add 'wp_nav_menu_item_custom_fields' hook in Walker_Nav_Menu_Edit::start_el()

WordPress Trac noreply at wordpress.org
Sun Feb 23 22:56:23 UTC 2020


#47056: Add 'wp_nav_menu_item_custom_fields' hook in
Walker_Nav_Menu_Edit::start_el()
--------------------------+-----------------------
 Reporter:  MikeSchinkel  |       Owner:  audrasjb
     Type:  enhancement   |      Status:  reopened
 Priority:  normal        |   Milestone:  5.4
Component:  Menus         |     Version:  5.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------
Changes (by celloexpressions):

 * keywords:  has-patch dev-feedback => has-patch
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 It is irresponsible to enable plugin authors to use a new hook, but only
 for users using a particular version of an interface. Including a
 customizer version of this hook is a requirement for adding the hook at
 all. We actually could have done that when that interface shipped in 4.3,
 but chose not to so that there was parity with wp-admin.

 I agree with others that it is well past time to fix this issue. Rather
 than revert and try again, I would suggest a simple action with no
 parameters in `class-wp-customize-nav-menu-item-control`. This allows
 plugins to add markup to the JavaScript template for menu items, and
 manage any custom fields in JavaScript. Note that menu-item-specific data
 is added to the markup template in JavaScript, so the PHP hook doesn't
 have or need parameter context. See [attachment:"47056-customize.diff"].

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


More information about the wp-trac mailing list