From 9b2334833df267f281011399db8a08aaff94cff5 Mon Sep 17 00:00:00 2001
From: Pieter Frenssen <pieter@frenssen.be>
Date: Mon, 22 Apr 2013 15:41:23 +0200
Subject: [PATCH] Issue #1966876 by pfrenssen, jonathan1055: Allow to alter the
 list of nodes to be published or unpublished.

---
 scheduler.module | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scheduler.module b/scheduler.module
index 5339efd..e838055 100644
--- a/scheduler.module
+++ b/scheduler.module
@@ -754,6 +754,10 @@ function _scheduler_publish() {
 
   $nids = array_unique(array_merge($nids, _scheduler_scheduler_nid_list('publish')));
 
+  // Allow other modules to alter the list of nodes to be published.
+  $action = 'publish';
+  drupal_alter('scheduler_nid_list', $nids, $action);
+
   foreach ($nids as $nid) {
     $n                 = node_load($nid);
     $n->changed        = $n->publish_on;
@@ -824,6 +828,10 @@ function _scheduler_unpublish() {
 
   $nids = array_unique(array_merge($nids, _scheduler_scheduler_nid_list('unpublish')));
 
+  // Allow other modules to alter the list of nodes to be unpublished.
+  $action = 'unpublish';
+  drupal_alter('scheduler_nid_list', $nids, $action);
+
   foreach ($nids as $nid) {
     // If this node is to be unpublished, we can update the node and remove the
     // record since it cannot be republished.
-- 
1.8.2.1

