0

I want to allow commenting on a custom post type by a specific user role. And a user can see only his comments only.

Scenario is

e.g User roles are student and instructor. The Student can comment on a lesson, which is a custom post type. An instructor can see his comment and then reply on it. Same the same student John can see only his comments and replies on his comments by his instructor.

I used the link for reference also using the comment_form for reference.

1
  • Please merge your accounts. You should not use a second account to answer your own question.
    – fuxia
    Commented Jan 22, 2017 at 5:01

1 Answer 1

0

Please check this

$args = array('post_author' => get_current_user_id(),);
$comments = get_comments( $args );
$list_args = array(
   'reverse_top_level' => false 
);
wp_list_comments( $list_args, $comments );
1
  • 1
    Please edit your answer, and add an explanation: why could that solve the problem?
    – fuxia
    Commented Jan 21, 2017 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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