Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_activity_content_body() : recent site wide posts (solved)

  • @rogercoathup

    Participant

    I want to implement an enhanced version of recent site wide posts.

    I want to be able to exclude certain blogs (such as blog id 1), and also retrieve a thumbnail image for each post.

    The BuddyPress built in widget (recent site wide posts) uses the activities loop to fetch post information (in particular the call bp_activity_content_body () ).

    Are there any guidelines / advice for modifying / accessing the information returned by bp_activity_content_body()?

Viewing 7 replies - 1 through 7 (of 7 total)
  • @apeatling

    Keymaster

    Yes, use the filter on that function in a separate plugin file.

    @rogercoathup

    Participant

    @Andy – yes, I was going to try and delve into that filter (the one on bp_get_activity_content_body, or did you mean a different one), and I guess I need to get in to the data structures in the activities_template.

    I’m a bit confused though… I only want to return something different when it’s being used in the specific instance of fetching sitewide posts. If I add the filter, won’t it affect all uses of bp_activity_content_body?

    @cavamondo

    Participant

    Did you find any solution?

    @aomao

    Participant

    Please I also need this one

    @themestown

    Member

    Not sure if it’s exactly what you’re looking for but you can try https://wordpress.org/extend/plugins/tt4bp-recent-sitewide-posts-widget/

    @rogercoathup

    Participant

    We just went with a loop like this:

    `
    <?php $args = array (
    ‘action’ => ‘new_blog_post’,
    ‘max’ => 20); ?>

      <?php
      while (bp_activities() ) : bp_the_activity(); ?>

      <?php $blog_id = bp_get_activity_item_id();

      if ((int)$blog_id == 1) continue; ?>

    `

    @boonebgorges has talked about adding ‘exclude’ parameters to some of the loop functions, which could make this much neater – I don’t know the progress / state of that work

    @r-a-y

    Keymaster

    It’s in BP 1.3 trunk I believe.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘bp_activity_content_body() : recent site wide posts (solved)’ is closed to new replies.
Skip to toolbar