i was trying to achieve this how can i restrict user to see his comments only along with admin replies and admin can see everyone comments?
Any suggestion with code would be helpful as i am new to wordpress.
i was trying to achieve this how can i restrict user to see his comments only along with admin replies and admin can see everyone comments?
Any suggestion with code would be helpful as i am new to wordpress.
Share Improve this question edited Jun 30, 2011 at 10:27 scribu 13.2k38 silver badges49 bronze badges asked Jun 30, 2011 at 7:14 KiranKiran 92 bronze badges2 Answers
Reset to default 2Semi-Private Comments.just install this plugin.This plugin masks comments so that a user can only see comments written by himself or by an admin. Admins can see all comments.
put this code in wp-admin/edit-comments.php
function myplugin_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_commentsment_post_ID = wp_posts.ID";
};
return $clauses;
};
// ensure that editors and admins can moderate everything
if(!current_user_can('edit_others_posts')) {
add_filter('comments_clauses', 'myplugin_get_comment_list_by_user');
}