Thread Starter
cat555
(@cat555)
Phil & Angelo,
Yep your right sorry thought I wouldn’t be able to get access to the events count from there.
function my_remove_events_tab()
{
global $bp, $EM_Notices;
$events = EM_Events::get(array('owner'=>$bp->displayed_user->id));
if( count($events) == 0 )
{
$bp->bp_nav['events'] = false;
bp_core_remove_subnav_item($bp->groups->slug, 'events');
}
}
add_action( 'bp_setup_nav', 'my_remove_events_tab' );
Works well
And I know now how to add my logic for being logged in…
Cheers!
Thread Starter
cat555
(@cat555)
Thanks angelo_nwl,
Yea I spotted that already it removes tab whether there is events or not for all users.
I want it to check if the user has events and if they do show it and if they don’t remove it.