This is a great little snippet if you want authors to look after their own comments. Only show the comments to the authors own posts within the wordpress admin, hide all other comments. Just add this snippet to the functions.php of your wordpress theme and you are ready to go.
[code lang=”php”]
function wps_get_comment_list_by_user($clauses) {
if (is_admin()) {
global $user_ID, $wpdb;
$clauses[‘join’] = “, wp_posts”;
$clauses[‘where’] .= ” AND wp_posts.post_author = “.$user_ID.”
AND wp_comments.comment_post_ID = wp_posts.ID”;
};
return $clauses;
};
if(!current_user_can(‘edit_others_posts’)) {
add_filter(‘comments_clauses’, ‘wps_get_comment_list_by_user’);
}
[/code]