BuddyDev

Search

How to remove following tab

  • Participant
    Level: Guru
    Posts: 701
    Tosin on #46478

    Hello sir,

    Please how can I remove the following tab in sitewide activity directory without using css

  • Keymaster
    (BuddyDev Team)
    Posts: 21769
    Brajesh Singh on #46484

    Hi Tosin,
    You may use the following css

    
    #activity-follow{  display:none;}
    

    If that does not work(may happen for some theme) you will need to ad the !important flag to enforce it.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 701
    Tosin on #46486

    Thanks Brajesh

    But I don’t want to use css to remove it a filter or code would be better

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 21769
    Brajesh Singh on #46490

    You may use the following code(Please test as I haven’t tested)

    
    
    add_action( 'bp_follow_activity_loaded', function () {
    
    	$bp = buddypress();
    
    	if ( empty( $bp->follow ) || empty( $bp->follow->activity ) || empty( $bp->follow->activity->module ) ) {
    		return;
    	}
    
    	if ( ! method_exists( $bp->follow->activity->module, 'add_activity_directory_tab' ) ) {
    		return;
    	}
    
    	remove_action( 'bp_before_activity_type_tab_favorites', array(
    		$bp->follow->activity->module,
    		'add_activity_directory_tab'
    	) );
    } );
    
    

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 701
    Tosin on #46492

    Just tested it but did not work

  • Keymaster
    (BuddyDev Team)
    Posts: 21769
    Brajesh Singh on #46494

    Have you put the code in bp-custom.php? It won’t work from your theme’s functions.php
    I will be testing later today after installing the plugin.

    Regards
    brajesh

  • Participant
    Level: Guru
    Posts: 701
    Tosin on #46495

    Yes I added it to bp-custom.php but did not work

  • Keymaster
    (BuddyDev Team)
    Posts: 21769
    Brajesh Singh on #46511

    Hi Tosin,
    I have checked it and it is working properly by removing the tab in Nouveau and legacy both.

    You probably have some other code causing it. I will suggest liming the custom code to above snippet and disabling all plugins except BuddyPress, BuddyPress Follow and trying with default WordPress theme.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved