Skip to:

Making bp_has_activities() have a global scope

  • Hi everyone,

    This one should be fairly obvious but I’m missing something — so when I try to access bp_has_activities(); on the main page it retrieves activity for all users, which is what I’m looking for:

    However, when I go to a profile page, the sidebar function only shows activity for that particular user when I would like it to retain all members from the main page:

    What are the parameters I should be pulling in? From the docs, it says that scope pulls out $bp->current_action, but that is an empty string on the front page, and the permutations of user_id or scope that I’ve tried doesn’t seem to do the trick either.

    – Ernie

Viewing 3 replies - 1 through 3 (of 3 total)
  • this is defined within the function, to pick up the profile of the user you are viewing…

    /* User filtering */
    if ( !empty( $bp->displayed_user->id ) )
    $user_id = $bp->displayed_user->id;

    but the wp_parse_args call is after – so have you tried passing in user_id=false to the loop?

    Boone Gorges


    Here are some of the accepted arguments:

    Also, check out the inline documentation in buddypress/bp-activity/bp-activity-templatetags.php.

    @nuprn1 is right that you need to pass in user_id=0.

    Thanks to both of you guys for your help and to the inline documentation! I didn’t realize that you had to set the user_id=0 and set the scope to zero as well.
    To anyone else looking:

    Will bring up global activity within a side bar fine, even if you’re on a profile page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Making bp_has_activities() have a global scope’ is closed to new replies.
Skip to toolbar