Skip to:
Content
Pages
Categories
Search
Top
Bottom

need exclude parameter for bp_has_activities()


  • Anointed
    Participant

    @anointed

    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);

Viewing 3 replies - 1 through 3 (of 3 total)

  • Roger Coathup
    Participant

    @rogercoathup

    @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

    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?


    Roger Coathup
    Participant

    @rogercoathup

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘need exclude parameter for bp_has_activities()’ is closed to new replies.
Skip to toolbar