Skip to content

Instantly share code, notes, and snippets.

@alvaromartinezmajado
Created May 11, 2015 03:21
Show Gist options
  • Save alvaromartinezmajado/6a5a498f5bc5cbe8ba95 to your computer and use it in GitHub Desktop.
Save alvaromartinezmajado/6a5a498f5bc5cbe8ba95 to your computer and use it in GitHub Desktop.
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