You are here

function hook_scheduler_unpublish_action in Scheduler 8

Hook function to process the unpublish action for a node.

This hook is called from schedulerManger::unpublish() and allows oher modules to process the unpublish action on a node during a cron run. The other module may require different functionality to be executed instead of the default unpublish process. If none of the invoked hook functions return a TRUE value then Scheduler will process the node using the default unpublish action, just as if no other hooks had been called.

This hook was introduced for scheduler_content_moderation_integration.

Parameters

\Drupal\node\NodeInterface $node: The $node object of the node being unpublished.

Return value

int 1 if this function has published the node or performed other such action meaning that Scheduler should NOT process the default publish action. 0 if nothing has been done and Scheduler should process the default publish action just as if this hook function did not exist. -1 if an error has occurred and Scheduler should abandon processing this node with no further action and move on to the next one.

See also

https://www.drupal.org/project/scheduler/issues/2798689

1 function implements hook_scheduler_unpublish_action()

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_unpublish_action in tests/modules/scheduler_api_test/scheduler_api_test.module
Implements hook_scheduler_unpublish_action().

File

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

Code

function hook_scheduler_unpublish_action(NodeInterface $node) {
  return 0;
}