在按Buddy键的情况下,向父菜单项添加子导航菜单项时遇到问题。
父菜单项如下所示,名为TEST
, 正确显示,但名为SUB NAV
和SUB NAV 2
根本不显示。
function my_setup_nav() {
global $bp;
$em_link = $bp->loggedin_user->domain . $bp->account->slug . \'/\';
# - add parent menu item
bp_core_new_nav_item( array(
\'name\' => \'TEST\',
\'slug\' => $bp->account->slug,
\'position\' => 10,
)
);
# - add sub nav menu items
bp_core_new_subnav_item( array(
\'name\' => \'SUB NAV\',
\'slug\' => \'account-sub\',
\'parent_url\' => $em_link ,
\'parent_slug\' => $bp->account->slug,
\'position\' => 10,
\'item_css_id\' => \'xx\'
)
);
bp_core_new_subnav_item( array(
\'name\' => \'SUB NAV 2\',
\'slug\' => \'account-sub-2\',
\'parent_url\' => $em_link ,
\'parent_slug\' => $bp->account->slug,
\'position\' => 20,
\'item_css_id\' => \'xx-2\'
)
);
}
add_action( \'bp_setup_nav\', \'my_setup_nav\', 99 );
使子导航项正常工作的正确语法是什么?