[wp-trac] [WordPress Trac] #35203: Capacity to change the type label in set nav menu items in Customize

WordPress Trac noreply at wordpress.org
Sat Apr 30 20:40:13 UTC 2016


#35203: Capacity to change the type label in set nav menu items in Customize
-------------------------+------------------
 Reporter:  joe_bopper   |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.6
Component:  Customize    |     Version:  4.3
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------
Changes (by celloexpressions):

 * keywords:   => has-patch
 * version:   => 4.3
 * milestone:  Awaiting Review => 4.6


Comment:

 Good idea @joe_bopper! [attachment:35203.diff] introduces a
 `customize_setup_nav_menu_item` filter, which behaves the same way as
 `wp_setup_nav_menu_item`, but is named differently in case in needs to be
 used differently for items in the customizer. It makes the two filters for
 more specific properties redundant, but we probably can't remove those at
 this point.

 For the issue mentioned in the ticket description, this can now be used
 as:
 {{{
 add_filter( 'customize_setup_nav_men_item', function( $menu_item ) {
      if ( conditional ) {
           $menu_item->type_label = __( 'Something Else' );
      }
      return $menu_item;
 }
 }}}

 @westonruter, are you okay with the naming of this? It's derived from this
 function's derivation from `wp_setup_nav_menu_item()`.

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


More information about the wp-trac mailing list