You are here

function hook_scheduler_publish_action in Scheduler 8

Hook function to process the publish action for a node.

This hook is called from schedulerManger::publish() and allows oher modules to process the publish action on a node during a cron run. The other module may require different functionality to be executed instead of the default publish process. If none of the invoked hook functions return a TRUE value then Scheduler will process the node using the default publish 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 published.

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_publish_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_publish_action in tests/modules/scheduler_api_test/scheduler_api_test.module
Implements hook_scheduler_publish_action().

File

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

Code

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