Created
May 11, 2015 03:21
-
-
Save alvaromartinezmajado/6a5a498f5bc5cbe8ba95 to your computer and use it in GitHub Desktop.
Remove the "profile" tab in buddypress except from user's own profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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