Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I get activities of subscribed groups?


  • athep
    Participant

    @athep

    Hello,

    I have this snippet that lists all the activity updates, I want to be able to fetch all the activity updates of only subscribed groups

    <?php if ( bp_has_activities('action=activity_update&user_id=' . get_current_user_id()) ): ?>
      <?php while ( bp_activities() ) : bp_the_activity(); ?>
        <?php bp_activity_content_body() ?>
      <?php endwhile; ?>
    <?php endif; ?>
    

    I thought inserting user_id would filter out the groups I’m not subscribed to but it’s fetching all the activities of the site

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

  • athep
    Participant

    @athep

    I have also tried this and it’s not working

    <?php if ( bp_has_groups( 'user_id=' . get_current_user_id() ) && bp_has_activities('action=activity_update') ): ?>


    athep
    Participant

    @athep

    I solved it by adding scope and I don’t know why, if anyone needs it, here it is bp_has_activities(bp_ajax_querystring( 'activity' ) . '&scope=groups&action=activity_update' )

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar