Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

need exclude parameter for bp_has_activities() (4 posts)

Started 1 year, 9 months ago by: Anointed

  • Profile picture of Anointed Anointed said 1 year, 9 months ago:

    I am trying to modify the primary bp activity stream loop to remove ‘all activities’ related to a set of specific blog id’s. However I do not see an exclude parameter as an option for the function bp_has_activities()

    In the meantime is there a workaround?

    –exclude_blog_id(3,6,29);

  • Profile picture of Roger Coathup Roger Coathup said 1 year, 9 months ago:

    @anointed – yes, it looks like you can specify blog_ids to specifically include, but not to exclude, in a call to bp_has_activities()

    My suggested workarounds:

    If you want to exclude the blogs on all calls to bp_has_activities() – Hook a function onto the bp_has_activities filter. That function should process the activities_template (passed as a parameter) removing the entries where the primary_id is in your blog ids to exclude.

    If you want to exclude the blogs on one specific call to bp_has_activities() – Check the primary_id of the activity item at the start of your loop, and skip processing if it’s in your list of blog ids to exclude. It’s not the most efficient, and might be a pain if you are counting returned results, but should work.

    Cheers, Roger

  • Profile picture of psycolor lorenzo said 1 year, 8 months ago:

    my post was never answered but the problem is similar: customising what goes in the main activity loop without using the plugin blocking certain types of activity altogether.

    does anyone have a good tutorial/docs explaining how to work on the customisation in more details with a practical example?

  • Profile picture of Roger Coathup Roger Coathup said 1 year, 8 months ago:

    @psycolor: the existing documentation on customising the activity loop can be found here: http://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/