BuddyDev

Search

[Resolved] Removing the notifications tab

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #48289

    Hi there, I’m trying to remove the notifications tab using this code from this post https://buddydev.com/support/forums/topic/remove-tabs-from-user-profiles/, but it has no effect.

    I know I can use css but I want to use php instead.

    Should I use a filter instead of an action hook?

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

    What happens when using this code, will live notifications not work?

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #48300

    Hi Carsten,
    Thank you for the question.

    1. Please use the code as below. The above action is for “Profile” component.

    
    
    /**
     * Remove notifications nav.
     */
    function buddydev_remove_notifications_tab() {
    	bp_core_remove_nav_item( 'notifications' );
    }
    
    add_action( 'bp_notifications_setup_nav', 'buddydev_remove_notifications_tab' );
    
    

    2. The live notifications should work fine but their linking may be broken if it links to user’s notification page.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #48308

    Hi Brajesh, thank you very much for the code snippet, it’s working perfectly.

    Also BuddyPress Live Notification is working with the code, and that’s what’s important to me.

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #48319

    Hi Carsten,

    It is good to know.

    I am glad it worked.

    Regards
    Brajesh

The topic ‘ [Resolved] Removing the notifications tab’ is closed to new replies.

This topic is: resolved