BuddyDev

Search

by Brajesh Singh

Permalink: #190

Remove Friendship Button on User Profile(removes add/remove/Cancel Friendship button from user profile)

//remove friendship button oon Single User profile
add_action('bp_init','bp_custom_remove_friendship_btn_on_profile');
function bp_custom_remove_friendship_btn_on_profile(){

    if ( has_action( 'bp_member_header_actions', 'bp_add_friend_button' ) ) {
            remove_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 );

    }

}

#buddypress #friends #bp-hacks

by Brajesh Singh

Permalink: #182

Hide Friends of a User from Other users. Only Site Admin and the User can see his/her Friends

/**
 * Hide User Friends from Other Users
 * Only Admin or the user himself can see friends
 */
add_action('bp_friends_setup_nav','bpdev_custom_hide_friends_if_not_self');

function bpdev_custom_hide_friends_if_not_self(){
    if( bp_is_my_profile() || is_super_admin() )
        return ;

    bp_core_remove_nav_item( 'friends' );

}


You can put the above code in bp-custom.php

#buddypress #friends #bp-hack

Subscribe