1.20.x comment.module comment_unpublish_action($comment, $context = array())

Unpublishes a comment.

Parameters

$comment: An optional comment object.

array $context: Array with components:

  • 'cid': Comment ID. Required if $comment is not given.

Related topics

File

modules/comment/comment.module, line 2381
Enables users to comment on published content.

Code

function comment_unpublish_action($comment, $context = array()) {
  $comment->status = COMMENT_NOT_PUBLISHED;
  $comment->save();
}