Unpublishes a node containing certain keywords.
$node: A node object to modify.
$context: Array with the following elements:
function node_unpublish_by_keyword_action($node, $context) {
foreach ($context['keywords'] as $keyword) {
$elements = node_view(clone $node);
if (strpos(drupal_render($elements), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) {
$node->status = NODE_NOT_PUBLISHED;
watchdog('action', 'Set @type %title to unpublished.', array(
'@type' => node_type_get_name($node),
'%title' => $node->title,
));
break;
}
}
}