Skip to:
Content
Pages
Categories
Search
Top
Bottom

Choosing activity stream information


  • creative nomad
    Participant

    @creative-nomad

    I would like to pick and choose what is shown in the activity stream. Ideally, I want to not show friendships made and blog posts posted. Is there a way to specify not to show these things

Viewing 1 replies (of 1 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    Yes, this can be done in code. You’ll need two filters. One removes the unwanted items from the dropdown on the activity page, and the other removes them from the activity stream itself.

    
    add_filter( 'bp_get_activity_show_filters_options', function( $filters ) {
    	unset( $filters['friendship_accepted,friendship_created'] );
    	unset( $filters['new_blog_post'] );
    	unset( $filters['new_blog_comment'] );
    	return $filters;
    } );
    
    add_filter( 'bp_before_has_activities_parse_args', function( $args ) {
    	$filter_query = array(
    		array(
    			'column' => 'type',
    			'value' => array( 'friendship_accepted', 'friendship_created', 'new_blog_post', 'new_blog_comment' ),
    			'compare' => 'NOT IN',
    		),
    	);
    
    	$args['filter_query'] = $filter_query;
    	return $args;
    } );
    
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar