1 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

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

Code

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