Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_has_activities() only show logged in user's activity

  • Hi there,

    I am trying to get the bp_has_activities function to only show the activity of the currently logged in user. If I do

    bp_has_activities(“user_id = 1″) That will only show the activity for that user. Great!

    However when I try to do something along the lines of:

    <?php

    global $bp;

    $com = “user_id = “.$bp->loggedin_user->id;

    if ( bp_has_activities($com) ): ?>

    it shows the activity of all the users.

    I have also tried ways such as :

    if ( bp_has_activities(“user_id = “.$bp->loggedin_user->id) )

    With no success.

    Is there any chance anyone can see where I am going wrong?

    Thanks for your time.

Viewing 1 replies (of 1 total)
  • After looking through the functions in bp-activity.php I realised what I should have been doing is passing an array to the function like:

    $com = array(“user_id” => $bp->loggedin_user->id);

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.