Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Filter the Activity Loop for Specific User Updates

@colingdi

Participant

That helped a lot, I’ve now got it filtering for the users activity on just their profile page. So we’re halfway there. Using your links I’m to the point where I have this code:

function my_filter_after_has_activities_parse_args( $r ) {
        $r['per_page'] = 10;
        if (bp_is_my_profile()) {
        $r['per_page'] = 3;
        $r['scope'] = "just-me";
        } else if (bp_is_user_profile()) {
        $r['per_page'] = 3;
        //$r['scope'] = "just-me"; - I'll work out the code for just-them after I get the function calling
        }
        
        return $r;
    }
    add_filter( 'bp_after_has_activities_parse_args', 'my_filter_after_has_activities_parse_args' );

When I run this code on a normal users profile I get nothing changed (the final bp_is_user_profile() doesn’t fire). I’m on the site.com/members/user page and it’s the ‘home.php’ template that’s calling all of this so I’m at a loss as to why I’m getting no joy.

Skip to toolbar