How to approve a comment in Drupal when admin is replying to that comment?

234 views Asked by At

I want to auto approve a comment when an admin is replying to a particular comment. This feature is available in wordpress.

1

There are 1 answers

0
Ajit S On

If you know how to write a module you could do that by implementing hook_comment_insert():

function MODULE_comment_insert($comment) {
  global $user;
  //check for the administrators
  if(in_array('administrator', array_values($user->roles))) {
    $comment->status = 1; // 0 for unpublished.
    comment_save($comment);
  }
}