I'm having trouble adding sub nav menu items to my parent menu item under Buddy Press.
The parent menu item as shown below, named TEST, shows correctly, but the tabs named SUB NAV and SUB NAV 2 don’t show at all.
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 );
What's the correct syntax for getting the Sub Navigation items to work correctly?