Sets the status of a node to 0 (unpublished).
Drupal\node\Node $node: A node entity.
$context: (optional) Array of additional information about what triggered the action. Not used for this action.
function node_unpublish_action(Node $node, $context = array()) {
$node->status = NODE_NOT_PUBLISHED;
watchdog('action', 'Set @type %title to unpublished.', array(
'@type' => node_get_type_label($node),
'%title' => $node
->label(),
));
}