Skip to:
Content
Pages
Categories
Search
Top
Bottom

Limit activity stream only to self


  • bogatajtadej
    Participant

    @bogatajtadej

    How can I limit the activity stream a user can see to only your own activity? I saw solutions so that you can only see it from you friends, but not this.
    Any idea?

    PS: the admin should also be able to see the activity stream of every user

Viewing 1 replies (of 1 total)

  • Prashant Singh
    Participant

    @prashantvatsh

    function ps_mine_activity_args( $args ) {
     
        if ( ! bp_is_activity_directory() || ! is_user_logged_in() || ! empty( $args['scope'] ) ) {
            return $args;
        }
     
        $user_id = get_current_user_id();
     
        $args['user_id'] = $user_id;
     
        return $args;
    
    }
    add_filter( 'bp_after_has_activities_parse_args', 'ps_mine_activity_args' );

    Please put the above given code in your bp-custom.php file or in your child theme’s functions.php file.

    Hope that it will show only logged-in user’s activities in the sitewide activity stream.

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