public static function NodeHelper::unpublishNode in Node expire 7.2
Unpublishes node by $nid.
1 call to NodeHelper::unpublishNode()
- ActionsHandler::doAction in src/
Module/ CommonExpire/ Actions/ ActionsHandler.php - Executes particular action with the node..
File
- src/
Module/ CommonExpire/ Node/ NodeHelper.php, line 30 - NodeHelper class.
Class
- NodeHelper
- NodeHelper class.
Namespace
Drupal\node_expire\Module\CommonExpire\NodeCode
public static function unpublishNode($nid) {
// Load the node object.
$node = node_load($nid);
// Set status property to 0.
$node->status = 0;
// Save the node.
node_save($node);
}