comment_unpublish_action($comment, $context = array())Unpublishes a comment.
$comment An optional comment object.
array $context Array with components:
modules/comment/comment.module, line 2407
<?php
function comment_unpublish_action($comment, $context = array()) {
if (isset($comment->comment)) {
$subject = $comment->subject;
$comment->status = COMMENT_NOT_PUBLISHED;
}
else {
$cid = $context['cid'];
$subject = db_query('SELECT subject FROM {comment} WHERE cid = :cid', array(':cid', $cid))->fetchField();
db_update('comment')
->fields(array('status' => COMMENT_NOT_PUBLISHED))
->condition('cid', $cid)
->execute();
}
watchdog('action', 'Unpublished comment %subject.', array('%subject' => $subject));
}
?>