BuddyDev

Search

Disable subnav friends

Tagged: 

  • Participant
    Level: Enlightened
    Posts: 27
    John Elmer on #41157

    Hi guys!

    Is possible to disable subnav activity-friends?

    Thank you!

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

    Hi John,

    Thank you for the question.

    Please use the following code.

    
    
    /**
     * Removes the 'friends' sub nav from activity.
     */
    add_action( 'bp_activity_setup_nav', function () {
    
    	if ( ! bp_is_active( 'friends' ) ) {
    		return;
    	}
    
    	bp_core_remove_subnav_item( bp_get_activity_slug(), bp_get_friends_slug() );
    } );
    
    /**
     * Removes 'friends' from account drop down menu in the admin bar.
     */
    add_action( 'bp_activity_setup_admin_bar', function () {
    
    	if ( ! bp_is_active( 'friends' ) ) {
    		return;
    	}
    
    	global $wp_admin_bar;
    	$wp_admin_bar->remove_node( 'my-account-activity-friends' );
    } );
    

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved