You are here

hook_cron_pre_execute.html in Ultimate Cron 8

Same filename and directory in other branches
  1. 6 help/hook_cron_pre_execute.html
  2. 7 help/hook_cron_pre_execute.html

File

help/hook_cron_pre_execute.html
View source
<p>The hook_cron_pre_execute($function, &$hook) is invoked just before running the cron function.</p>

<h3>Example</h3>
<p>Call another function instead of the defined</p>
<pre>
function hook_cron_pre_execute($function, &$hook) {
  if ($function == 'node_cron') {
    $hook['callback'] = 'mymodule_steal_cron_function_from_node_module';
  }
}

function mymodule_steal_cron_function_from_node_module() {
  error_log('PWNED');
}
</pre>