[wp-trac] [WordPress Trac] #24644: Add "parent" class to menu items with sub-menus
WordPress Trac
noreply at wordpress.org
Wed Jun 26 10:33:33 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 | Keywords:
-------------------------+-----------------------------
Currently there is no way to indicate that a menu has sub-menu (by
inserting an arrow pointing downwards next to parent menu item) without
custom menu walker or filters that will add 'parent' class to menu items
that have sub-menus.
It would be great if that could become a default class in WordPress.
{{{
function add_parent_css( $classes, $item ) {
global $dd_children;
if( $dd_children ) {
$classes[] = 'parent';
}
return $classes;
}
add_filter( 'nav_menu_css_class', 'add_parent_css', 10, 2 );
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24644>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list