Created
February 3, 2013 14:25
-
-
Save imath/4701996 to your computer and use it in GitHub Desktop.
this is a little BuddyPress trick to hide friends nav and activity friends subnav to members visiting other member profiles. It's a reply to this topic :
http://bp-fr.net/groupes/utilisation-configuration-optimisation-de-buddypress/forum/topic/supprimer-longlet-amis-de-la-fiche-dun-membre/
This file contains hidden or 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
<?php | |
/**** beginning of the code to copy in the functions.php file of active theme ****/ | |
function mathieu_hides_friends_nav( $nav_items, $nav_items_args ) { | |
if( is_super_admin() ) | |
return $nav_items; | |
if( bp_is_user() && !bp_is_my_profile() ) | |
return false; | |
else | |
return $nav_items; | |
} | |
add_filter( 'bp_get_displayed_user_nav_friends', 'mathieu_hides_friends_nav', 10, 2 ); | |
add_filter( 'bp_get_options_nav_activity-friends', 'mathieu_hides_friends_nav', 10, 2 ); | |
/**** end of the code to copy ****/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment