Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove nested group post replies from activity stream

  • @julia_b

    Participant

    I’ve just started my first group on my buddypress site, but the chat is clogging up my site-wide activity feed too much.

    The problem is that when someone replies to a post in the group it appears on the feed twice – once as a normal activity feed item and then again as a nested reply under the feed item for the original post which the person is replying to. This leads to the same post appearing multiple times

    Below is a screengrab of the activity feed on my homepage to illustrate the issue.

    Is there an easy way to stop the nested replies from showing? I’m not a professional site builder, so I’m hoping this is simple to change!

    Thanks 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • @julia_b

    Participant

    Anyone able to help with the above please?

    Looking at the site again today, I’m thinking the best solution to the duplication issue could be to remove ‘activity comments’ from the activity feed so replies only appear under the original post.

    Is that possible?

    @danbp

    Participant

    Hi @julia_b,

    try this snippet (bp-custom.php)

    function bpfr_activity_nocomment( $can_comment = true, $type = '' ) {
            if ( empty( $can_comment ) ) {
                    return $can_comment;
            }
     
            // activities which can't be commented
            $cant_comment_types = array( 
    				'bbp_topic_create' => 1,
    				'bbp_reply_create' => 1,
            );
     
            return ! isset( $cant_comment_types[ $type ] );
    }
    add_filter( 'bp_activity_can_comment', 'bpfr_activity_nocomment', 10, 2 );

    This is only an example. To get the exact activity name you want to disallow comments on the feed, see in xx_bp_activities table

    @julia_b

    Participant

    Thanks @danhp, so if I use this will people still be able to comment on posts in the group, but the activity comments won’t appear in the activity feed?

    I don’t want to disallow comments in the group, just to stop them appearing on the activity feed on my homepage.

    Really appreciate the help. You rock!

    @julia_b

    Participant

    Can anyone help with this please?

    thanks 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove nested group post replies from activity stream’ is closed to new replies.
Skip to toolbar