当管理员回复Drupal中的评论时,如何批准该评论?
我想在管理员回复特定评论时自动批准评论。此功能在wordpress中提供 如果您知道如何编写模块,您可以通过实现:当管理员回复Drupal中的评论时,如何批准该评论?,drupal,drupal-7,drupal-comments,Drupal,Drupal 7,Drupal Comments,我想在管理员回复特定评论时自动批准评论。此功能在wordpress中提供 如果您知道如何编写模块,您可以通过实现: function MODULE_comment_insert($comment) { global $user; //check for the administrators if(in_array('administrator', array_values($user->roles))) { $comment->status = 1; // 0 f
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);
}
}