raw
mp-wp_genesis           1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * WordPress Cron Implementation for hosts, which do not offer CRON or for which
mp-wp_genesis 4 * the user has not setup a CRON job pointing to this file.
mp-wp_genesis 5 *
mp-wp_genesis 6 * The HTTP request to this file will not slow down the visitor who happens to
mp-wp_genesis 7 * visit when the cron job is needed to run.
mp-wp_genesis 8 *
mp-wp_genesis 9 * @package WordPress
mp-wp_genesis 10 */
mp-wp_genesis 11
mp-wp_genesis 12 ignore_user_abort(true);
mp-wp_genesis 13
mp-wp_genesis 14 /**
mp-wp_genesis 15 * Tell WordPress we are doing the CRON task.
mp-wp_genesis 16 *
mp-wp_genesis 17 * @var bool
mp-wp_genesis 18 */
mp-wp_genesis 19 define('DOING_CRON', true);
mp-wp_genesis 20 /** Setup WordPress environment */
mp-wp_genesis 21 require_once('./wp-load.php');
mp-wp_genesis 22
mp-wp_genesis 23 if ( $_GET['check'] != wp_hash('187425') )
mp-wp_genesis 24 exit;
mp-wp_genesis 25
mp-wp_genesis 26 $local_time = time();
mp-wp_genesis 27
mp-wp_genesis 28 $crons = _get_cron_array();
mp-wp_genesis 29 $keys = array_keys( $crons );
mp-wp_genesis 30
mp-wp_genesis 31 if (!is_array($crons) || $keys[0] > $local_time) {
mp-wp_genesis 32 update_option('doing_cron', 0);
mp-wp_genesis 33 return;
mp-wp_genesis 34 }
mp-wp_genesis 35
mp-wp_genesis 36 foreach ($crons as $timestamp => $cronhooks) {
mp-wp_genesis 37
mp-wp_genesis 38 if ( $timestamp > $local_time )
mp-wp_genesis 39 break;
mp-wp_genesis 40
mp-wp_genesis 41 foreach ($cronhooks as $hook => $keys) {
mp-wp_genesis 42
mp-wp_genesis 43 foreach ($keys as $k => $v) {
mp-wp_genesis 44
mp-wp_genesis 45 $schedule = $v['schedule'];
mp-wp_genesis 46
mp-wp_genesis 47 if ($schedule != false) {
mp-wp_genesis 48 $new_args = array($timestamp, $schedule, $hook, $v['args']);
mp-wp_genesis 49 call_user_func_array('wp_reschedule_event', $new_args);
mp-wp_genesis 50 }
mp-wp_genesis 51
mp-wp_genesis 52 wp_unschedule_event($timestamp, $hook, $v['args']);
mp-wp_genesis 53
mp-wp_genesis 54 do_action_ref_array($hook, $v['args']);
mp-wp_genesis 55 }
mp-wp_genesis 56 }
mp-wp_genesis 57 }
mp-wp_genesis 58
mp-wp_genesis 59 update_option('doing_cron', 0);
mp-wp_genesis 60
mp-wp_genesis 61 die();
mp-wp_genesis 62
mp-wp_genesis 63 ?>