[wp-trac] [WordPress Trac] #32708: Request about the WP_Customize_Nav_Menus class (include 2 filters)

WordPress Trac noreply at wordpress.org
Thu Jun 18 20:38:55 UTC 2015


#32708: Request about the WP_Customize_Nav_Menus class (include 2 filters)
-------------------------+-----------------------------
 Reporter:  imath        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Menus        |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Hi,

 First, congrats for the great work in this area, it's a really interesting
 experience to set the nav menus using the customizer.

 In BuddyPress, we are using a specific meta box into the WP Nav Menu
 administration screen to let Administrators build a dynamic user
 navigation. Depending on the user who is connected, the different links
 are customized at run time. We introduced this feature in version 1.9.

 We have a [https://buddypress.trac.wordpress.org/ticket/6509 ticket on our
 trac] that suggests to use the new Customizer Nav menus feature. I've
 explored a bit the WP_Customize_Nav_Menus and, unless i've missed
 something, i haven't found how to extend it. I guess we could create a new
 customizer control or fake a post type and corresponding entries, but i
 thought let's ask WordPress if it's possible to adapt the customizer
 before completely rebuilding the BP dynamic user navigation feature :)

 I saw in the code a 'todo' comment about using
 add_meta_box/do_accordion_section so maybe this request comes too early,
 if so i'm sorry.

 The request: would it be possible to include 2 filters inside the class ?
 - one to let plugins (BuddyPress for my case) "register" a new item type
 in `WP_Customize_Nav_Menus->available_item_types()`
 - another to populate the corresponding items in
 `WP_Customize_Nav_Menus->ajax_load_available_items()`

 I've tried to limit the number of hooks by editing the way
 WP_Customize_Nav_Menus->available_items_template() is building the
 templates so that you keep the control on how the accodion sections are
 structured.

 I've quickly wrote the attached patch to illustrate my request.

 Thanks a lot for your time.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32708>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list