When I try creating a schedule, I get an “Illegal Offset” error in /wp-includes/cron.php on line 79. Since I didn’t edit the core cron.php file, I’m not sure what’s wrong. Here’s my code that calls the function:
<?php
class ClassName {
// This function runs instantly when the class is called
function __construct(){
$start_date = strtotime('27 September 2011');
wp_schedule_event($start_date, 'hourly', array(&$this, 'do_cron'));
}
// The cron data
function do_cron(){
die('The cron data is here!');
}
}// end class
// Run the class
$class = new ClassName();
?>
And just in case you don't want to look, line 79 of cron.php is:
$crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args, 'interval' => $event->interval );
Any ideas? I'm stumped!