Skip to:

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#5851 closed enhancement (no action required)

Add bp_has_activities param to exclude profile activity

Reported by: tobyhawkins's profile tobyhawkins Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Core Keywords:


When setting up a sitewide feed I have found it useful to remove personal activity (i.e. profile based activity) from the feed, focussing on group/public activity across the site. Thought I'd suggest it here to see what people thought about adding the option.

Since item_id in wp_bp_activity will be 0 if an activity item is on someone's profile I have added

'non_profile' => false,

to the defaults in the get() function in bp-activity-classes.php

And then

if ( $non_profile ) $where_conditions['non_profile'] = 'a.item_id > 0';

To the where conditions in the same.

I've then added the defaults/variable handling to all the other relevant functions:


in bp-activity-functions.php


in the BP_Activity_Template class in bp-activity-template.php

My apologies if there is a simpler way to do this that I've missed, or if this is too specific to be of general use.

Change History (2)

#1 @boonebgorges
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

tobyhawkins - Thanks very much for the suggestion. Your use case is totally valid, but the request is, as you suggest, a bit too specific to be appropriate for BP.

However, what you're looking to accomplish will be very doable once #4988 is in BP (probably for BP 2.2). We're still working on the exact syntax, but the precise logic of your suggestion patch would probably look something like this:

bp_has_activities( array(
    'filter_query' => array(
            'item_id' => 0,
            'compare' => '>',
    // ...
) );

Please monitor that ticket for updates, and feel free to chime in with additional thoughts. Thanks!

#2 @tobyhawkins
10 years ago

Grand, thanks. Will do.

Note: See TracTickets for help on using tickets.