how to hide a plugin generated buddypress tab
-
WP+BP Versions= Latest.
urban-fix.co.ukI would like to hide a plugin generated buddypress tab, so after looking around I found this code and modified it a little:
<?php function bp_remove_nav_item() { if(current_user_cannot(“access_s2member_level2″)) global $bp; bp_core_remove_subnav_item( $bp->profile->slug, ‘change-avatar’ ); } add_action( ‘wp’, ‘bp_remove_nav_item’ ); ?>
This worked perfectly well so i edited the following line:
bp_core_remove_subnav_item( $bp->profile->slug, ‘change-avatar’ );
to
bp_core_remove_nav_item('listings');
And now the full code looks like this;
function bp_remove_nav_item() { if(is_user_logged_in("true") ) if(current_user_cannot("access_s2member_level2")) global $bp; bp_core_remove_nav_item('listings'); } add_action( 'wp', 'bp_remove_nav_item' );
However this removes the ‘listings’ tab for all, any idea what im doing wrong?
Thanks in advance,
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘how to hide a plugin generated buddypress tab’ is closed to new replies.