3 * WordPress Cron Implementation for hosts, which do not offer CRON or for which
4 * the user has not set up a CRON job pointing to this file.
6 * The HTTP request to this file will not slow down the visitor who happens to
7 * visit when the cron job is needed to run.
12 ignore_user_abort(true);
14 if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') )
18 * Tell WordPress we are doing the CRON task.
22 define('DOING_CRON', true);
24 if ( !defined('ABSPATH') ) {
25 /** Set up WordPress environment */
26 require_once('./wp-load.php');
29 if ( false === $crons = _get_cron_array() )
32 $keys = array_keys( $crons );
35 if ( isset($keys[0]) && $keys[0] > $local_time )
38 foreach ($crons as $timestamp => $cronhooks) {
39 if ( $timestamp > $local_time )
42 foreach ($cronhooks as $hook => $keys) {
44 foreach ($keys as $k => $v) {
46 $schedule = $v['schedule'];
48 if ($schedule != false) {
49 $new_args = array($timestamp, $schedule, $hook, $v['args']);
50 call_user_func_array('wp_reschedule_event', $new_args);
53 wp_unschedule_event($timestamp, $hook, $v['args']);
55 do_action_ref_array($hook, $v['args']);