Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • gabelon
    Participant

    @gabelon

    Hi, where should I add the categories to be excluded?
    For example, if I want to exclude from the Activity stream, posts categorized as “category1” and “category2” do I need to replace like this?:

    function add_excluded_type( $where_conditions, $r, $select_sql, $from_sql, $join_sql ) {
    	$type_to_exclude = 'category1,category2';
    
    	$where_conditions['excluded_types'] = ! empty( $where_conditions['excluded_types'] )
    		? preg_replace( '/\)$/', ", '$type_to_exclude'$0", $where_conditions['excluded_types'] )
    		: "a.type NOT IN ('$type_to_exclude')";
    	
    	return $where_conditions;
    }
    
    add_filter( 'bp_activity_get_where_conditions', 'add_excluded_type', 10, 5 );

    Thanks

Viewing 1 replies (of 1 total)
Skip to toolbar