Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

2 Answers 2

Semi-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.

share|improve this answer
    
is there any way without installing plugin... –  Kiran Jul 1 '11 at 12:02
    
@kiran you are asking too much ... There is no way a vanilla Wordpress install can do what you ask. –  Lamnk Jul 2 '11 at 2:27

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_comments.comment_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');
}
share|improve this answer
1  
Editing core admin files is bad practice and absolutely not recommended. Besides that, please add an explanation to your answer. –  ialocin Feb 12 at 12:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.