BuddyDev

Search

[Resolved] remove tabs from user profiles

  • Participant
    Level: Enlightened
    Posts: 118
    chris on #17579

    HI,

    We would like to reorder tabs and remove some on the USER profile page.

    I followed the directions here:
    p_core_remove_nav_item('profile ); //change with the slug

    and it took the entire site down. I simply would like to be able to hide certain tabs

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #17580

    Hi Chris,
    Please use

    
    bp_core_remove_nav_item( 'profile');
    
    

    The code you have used will cause fatal and that’s why your site got down.

    Let me know it if works for you or not?

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 118
    chris on #17582
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #17583

    Hi Chris,
    Please post the complete code for removing the tab. It should not be called directly and should be called on some action(bp_setup_nav) or similar.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 118
    chris on #17585
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #17586

    HI Chris,

    Please remove this line at the bottom

    
    bp_core_remove_nav_item( 'profile');
    
    

    It should not be called directly.

    Now, you can add the following to remove profie tab

    
    
    /**
     * Remove profile nav.
     */
    function buddydev_remove_profile_tab() {
    	bp_core_remove_nav_item( 'profile' );
    }
    
    add_action( 'bp_xprofile_setup_nav', 'buddydev_remove_profile_tab' );
    

    That will remove profile tab for all.

  • Participant
    Level: Enlightened
    Posts: 118
    chris on #17587

    Hi Brajesh,

    If we remove this from the profile tab menu, can a user still access their profile from our side menu?

    Also, we would like to remove from the tabbed menu” Profile, Notifications, Groups, forums”

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #17588

    Hi Chris,
    Once a tab is removed by the above method, It can not be accessed. Do you really want that?

    If yes, why not disable the components instead if you don’t need them?

  • Participant
    Level: Enlightened
    Posts: 118
    chris on #17589

    good question. Perhaps we will think a bit further

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #17597

    Sure. The above code can use with with some additional conditions to remove tab based in certain scenerio.

    If you don’t need the tab at all, disabling component seems better.

    Regards
    Brajesh

The topic ‘ [Resolved] remove tabs from user profiles’ is closed to new replies.

This topic is: resolved