1 node.actions.inc node_unpublish_action(Node $node, &$context)

Sets the status of a node to 0 (unpublished).

Parameters

Node $node: A node entity.

$context: Contextual information about the triggered action..

Related topics

File

core/modules/node/node.actions.inc, line 32
Action callbacks for Node module.

Code

function node_unpublish_action(Node $node, &$context) {
  $node->status = NODE_NOT_PUBLISHED;
  $node->save();
}