Re: Groups Posts and Disable Avatars
The most straightforward way is to hook a custom function to `comment_post` and `edit_comment`. The function would look something like this (mainly copied-and-pasted from bp-blogs.php, `bp_blogs_record_comment()` ):
`
function boone_record_blog_comment_to_group( $comment_id, $is_approved = true ) {
$action = ‘something’; // here’s where you’ll put together the action, something like ‘[Group member] commented on [blog post]’, with the appropriate links;
$content = ‘something’; // Get the comment content from the $comment_id passed into the function
$primary_link = ‘something’; // Get the comment permalink from the $comment_id
$blog_id = ‘something’; // You’ll have to get the blog id either from $current_blog or from the comment metadata
groups_record_activity( array(
‘action’ => $action,
‘content’ => $content,
‘type’ => ‘new_blog_comment’,
‘item_id’ => $bp->groups->new_group_id,
‘secondary_item_id’ => $blog_id
) );
}
add_action( ‘comment_post’, ‘boone_record_blog_comment_to_group’, 10, 2 );
add_action( ‘edit_comment’, ‘boone_record_blog_comment_to_group’, 10 );
`
You’ll have to do the grunt work of figuring out how best to populate those variables at the beginning of the function, but this is a step in the right direction.