Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Mathieu Viet

    (@imath)

    Hello,

    You should be able to achieve this by adding this snippet of code to a bp-custom.php file:

    function rukunpuc_my_profile_only() {
    	$has_access = (bool) bp_is_my_profile() || bp_current_user_can( 'bp_moderate' );
    
    	buddypress()->bp_nav['buddydrive']['show_for_displayed_user']          = $has_access;
    	buddypress()->bp_options_nav['buddydrive']['files']['user_has_access'] = $has_access;
    
    	if ( ! $has_access && bp_is_user() && bp_is_current_component( 'buddydrive' ) ) {
    		wp_die( 'You are not allowed to access this part of the site' );
    	}
    }
    add_action( 'bp_buddydrive_setup_nav', 'rukunpuc_my_profile_only' );
    Thread Starter rukunpuc

    (@rukunpuc)

    Thank you so much for your reply. Is there any way to keep the buddydrive css retain , in my case it goes with the theme css and the tool menu items: (Create, delete,edit)are not being aligned horizontally,rather they are showing on seperate line.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide Buddydrive tab when access one user's profile from other user account’ is closed to new replies.