You are here

function hook_scheduler_nid_list_alter in Scheduler 8

Same name and namespace in other branches
  1. 7 scheduler.api.php \hook_scheduler_nid_list_alter()

Hook function to manipulate the list of nodes being processed.

This hook allows modules to add or remove node ids from the list being processed in the current cron run. It is invoked during cron runs only. It can do everything that hook_scheduler_nid_list() does, plus more.

Parameters

array $nids: An array of node ids being processed.

string $action: The action being done to the node - 'publish' or 'unpublish'.

Return value

array The full array of node ids to process, adjusted as required.

1 function implements hook_scheduler_nid_list_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

scheduler_api_test_scheduler_nid_list_alter in tests/modules/scheduler_api_test/scheduler_api_test.module
Implements hook_scheduler_nid_list_alter().
2 invocations of hook_scheduler_nid_list_alter()
SchedulerManager::publish in src/SchedulerManager.php
Publish scheduled nodes.
SchedulerManager::unpublish in src/SchedulerManager.php
Unpublish scheduled nodes.

File

./scheduler.api.php, line 48
API documentation for the Scheduler module.

Code

function hook_scheduler_nid_list_alter(array &$nids, $action) {

  // Do some processing to add or remove node ids.
  return $nids;
}