Wordpress:根据父li类设置ul菜单类

时间:2014-06-20 15:19:02

标签: wordpress drop-down-menu

我该怎么做?我正在开发自定义菜单功能,我知道我必须使用start_lvl

public function start_lvl( &$output, $depth = 0, $args = array() ) {
    $indent = str_repeat( "\t", $depth );
        $classes = get_parent_menu_item_classes(); // I NEED SOMETHING LIKE THIS
    if ( in_array( 'column-header', $classes ) ) { // get the classes here
        $output .= "\n$indent<ul role=\"menu\" class=\" nav nav-list\">\n";
    } else {
        $output .= "\n$indent<ul role=\"menu\" class=\" dropdown-menu\">\n";
    }
}

请告知:)

0 个答案:

没有答案
相关问题