Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filter activity from “Everything” only

  • @aronprins

    Participant

    Hey everyone,

    I’m trying to remove group related activity from the “Everything”, but keep it under the my groups tab but can’t find a way to do it on the forums. I found this https://buddypress.org/support/topic/disable-group-posts-from-main-activity-stream/ but this also removes it from the my groups tab 🙁

    Does someone perhaps have a snippet laying around or can point me in the right direction to check which tab is selected?

    Thanks,
    Aron

Viewing 2 replies - 1 through 2 (of 2 total)
  • @nahummadrid

    Participant

    I always reference this https://buddypress.org/support/topic/choosing-activity-stream-information/ but maybe something like, untested

    add_filter( 'bp_before_has_activities_parse_args', function( $args ) {
    	
    if(bp_is_current_action( 'groups' )) {
    
     $args['object'] = array('groups');
    
    } else {
    $filter_query = array(
    		array(
    			'column' => 'type',
    			'value' => array( 'group_action_1', 'group_action_etc' ),
    			'compare' => 'NOT IN',
    		),
    	);
    
    	$args['filter_query'] = $filter_query;
    }
    
    	return $args;
    } );

    @aronprins

    Participant

    Thanks @nahummadrid!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar