is this something new, ie did it used to work, or is just something you have found, so don’t know?
I noticed it when I was restricting a forum to a staff group.
Since the topics of nature would be sensitive, I checked the buddypress activity feed and noticed that an entry was still being created and visible to any group.
I was able to get around this by writing a function that disabled any activity feed post if the forum was set to hidden/private.
So I would restrict the forum to the staff group and set that forum to hidden and when a new topic was created, no new buddypress activity feed entry was created either.
thanks, can you share the code here please
This is the code I used. I did very little testing with it but from what I did test, if I set the forum to hidden/private then it would not post a buddypress activity. This works for what I need – which is a private forum restricted with private groups
function disable_bp_activity_for_hidden_private_forums($topic_id) {
$forum_id = bbp_get_topic_forum_id($topic_id);
$forum_visibility = bbp_get_forum_visibility($forum_id);
if ($forum_visibility === 'hidden' || $forum_visibility === 'private') {
$activity_id = bp_activity_get_activity_id(array(
'component' => 'bbpress',
'type' => 'bbp_topic_create',
'item_id' => $topic_id,
));
if (!empty($activity_id)) {
bp_activity_delete_by_activity_id($activity_id);
}
}
}
add_action('bbp_new_topic', 'disable_bp_activity_for_hidden_private_forums', 10, 1);
thanks, I’ll look at this when I get back from holiday and see if I can fix