WordPress Cron Job
Just set this for a daily event. Then re activate your theme
register_activation_hook(__FILE__, 'my_activation');
function my_activation() {
if (! wp_next_scheduled ( 'my_daily_event' )) {
wp_schedule_event(time(), 'daily', 'my_daily_event');
}
}
add_action('my_daily_event', 'expired_downloads_handler');
register_deactivation_hook(__FILE__, 'my_deactivation');
function my_deactivation() {
wp_clear_scheduled_hook('my_daily_event');
}
Check it with this
echo '<pre>'; print_r( _get_cron_array() ); echo '</pre>';