Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Remove the "profile" tab in buddypress except from user's own profile
function bp_remove_nav_item() {
global $bp;
$current_user = wp_get_current_user();
if ($bp->displayed_user->id !== $current_user->ID ) {
bp_core_remove_nav_item( $bp->profile->slug, 'profile' );
add_action( 'bp_setup_nav', 'bp_remove_nav_item' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.