comment_unpublish_by_keyword_action($comment, $context)Unpublishes a comment if it contains certain keywords.
comment_unpublish_by_keyword_action_form()
@see comment_unpublish_by_keyword_action_submit()
$comment Comment object to modify.
array $context Array with components:
modules/comment/comment.module, line 2437
<?php
function comment_unpublish_by_keyword_action($comment, $context) {
foreach ($context['keywords'] as $keyword) {
$text = drupal_render($comment);
if (strpos($text, $keyword) !== FALSE) {
$comment->status = COMMENT_NOT_PUBLISHED;
watchdog('action', 'Unpublished comment %subject.', array('%subject' => $comment->subject));
break;
}
}
}
?>