Since BuddyPress 2.0.0 you can use this in bp-custom.php
function namrons_activity_nocomment( $can_comment = true, $type = '' ) {
if ( empty( $can_comment ) ) {
return $can_comment;
}
// activities which can't be commented
$cant_comment_types = array(
'new_forum_topic' => 1,
'new_forum_post' => 1,
);
return ! isset( $cant_comment_types[ $type ] );
}
add_filter( 'bp_activity_can_comment', 'namrons_activity_nocomment', 10, 2 );
Thanks for your responses.
@danbp I switched “Allow activity stream commenting on blog and forum posts” back on and I tried your suggestion but it has had not effect, unfortunately. Any more ideas?
Oh, sorry, i haven’t tested !
Change $cant_comment_types = array
to
$cant_comment_types = array(
'bbp_topic_create' => 1,
'bbp_reply_create' => 1,
);
In BP settings, enable Allow activity stream commenting.
Check also that you disabled search engine visibility option. Dashboard > General > Read
Is at least important for blog comments to appear on SWA.
Thanks so much @danbp. That worked perfectly! However I have not disabled the search engine visibility option as I don’t understand the logic behind this?
Thanks @danbp – I was looking for how to do this. Then I figured out how to pull the other activities from my database and was able to customize commenting options on several other activities. Tres cool. 🙂
Just wanted to say thanks for sharing.
namrons
@namrons
9 years, 9 months ago
In Buddypress settings there is unfortunately only one setting that controls the ability to comment on both blog and forum posts which appear on the activity stream. There is the check box “Allow activity stream commenting on blog and forum posts”.
My issue is that I require activity stream commenting on blog posts but do not want them on forum posts. Logically, there is no reason why there should be one setting controlling both. Is it perhaps possible to separate the two so that users have this freedom?