Lesson comments do not show within associated course group?
-
Hello!
I only want to use this plugin so that comments created within lessons are posted/shared within buddypress groups that are tied with the relevant course.
After installing the plugin and setting it up, I was impressed as it seemed to do the trick after posting a test comment in the first lesson of a course. However, I shortly discovered that for some reason this only works with ONE single lesson? For example..
I post a comment in Lesson1, it shows in the group activity feed. I post a comment in Lesson2 (or any other), the comment does not display in the group activity feed.
How is it possible that the plugin would only work with one lesson and not all lessons?
I have tried deactivating all plugins and changing themes to see if there are any conflicts, but I have found none.
Previously, I was using this code:
/* Post Comments in Buddypress Activity */ function bca_record_activity($comment_id, $approval) { if($approval == 1) { $comment = get_comment($comment_id); $userlink = bp_core_get_userlink($comment->user_id); $postlink = '<a href="' . get_permalink($comment->comment_post_ID) . '">' . get_the_title($comment->comment_post_ID) . '</a>'; bp_activity_add(array( 'action' => sprintf( __( '%1$s commented on the lesson: %2$s', 'buddypress' ), $userlink, $postlink), 'content' => $comment->comment_content, 'component' => 'bp_plugin', 'user_id' => $comment->user_id, 'type' => 'new_blog_comment', )); } } //comment_post is triggered "just after a comment is saved in the database". add_action('comment_post', 'bca_record_activity', 10, 2); // We want activity entries of blog comments to be shown as "mini"-entries function bca_minify_activity($array) { $array[] = 'new_blog_comment'; return $array; } add_filter('bp_activity_mini_activity_types', 'bca_minify_activity'); // Disables comments on this type of activity entry function bca_remove_commenting($can_comment) { if($can_comment == true) { $can_comment = ! ('new_blog_comment' == bp_get_activity_action_name()); } return $can_comment; } add_filter('bp_activity_can_comment', 'bca_remove_commenting');
Is there any way I might be able to simply adapt that code so that rather than comments appearing in activity feeds, they rather appear in the corresponding course group associated with the lesson?
Thanks!!
- The topic ‘Lesson comments do not show within associated course group?’ is closed to new replies.