[wp-trac] [WordPress Trac] #24644: Add "parent" class to menu items with sub-menus

WordPress Trac noreply at wordpress.org
Wed Jun 26 10:44:25 UTC 2013


#24644: Add "parent" class to menu items with sub-menus
-------------------------+------------------------------
 Reporter:  Looimaster   |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Menus        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------------------

Comment (by Looimaster):

 And here's the rest of the walker (can't update my original suggestion):


 {{{
 class custom_walker extends Walker_Nav_Menu {
         function display_element($element, &$children_elements,
 $max_depth, $depth=0, $args, &$output){
         $GLOBALS['dd_children'] =
 (isset($children_elements[$element->ID]))? 1:0;
         parent::display_element($element, $children_elements, $max_depth,
 $depth, $args, $output);
     }
 }}}

 The reason I'm asking this is because plugins such as WPML add 'language
 switcher' as menu item and they ignore custom walker. Instead of chasing
 plugin authors and dropping them suggestions this could be a default
 feature of WordPress.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24644#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list