I can place the code to schedule an event in the header and "Cron GUI" shows that it is registered but when I place it like below I get nothing. I put a die('YAY'); in each step and they're getting hit but still no scheduled event. The plugin is initialized on init.
class MyPlugin {
function __construct() {
$this->init(); // loads the courses class and inits
register_activation_hook( __FILE__, array(&$this, 'activation') );
}
function activation() { do_action( 'myplugin_activation' ); }
}
class Courses {
function Courses() {
add_action( 'myplugin_activation', array($this, 'activation') );
add_action( 'session_expiry_event', array($this, 'session_expiry') );
}
function activation() { wp_schedule_event(time(), 'daily', 'session_expiry_event'); }
function session_expiry() {/* blah blah */}
}
Any thoughts?