• Hello i want that my cron would call function every day at 2 o`clock am. Do I write correct ? Or something wrong? because its not working..

    register_activation_hook(__FILE__, 'my_activation');
    add_action('my_hourly_event', 'do_this_hourly');
    
    function my_activation() {
    	wp_schedule_event(strtotime(date('Y-m-d 00:02:00')), 'daily', 'my_hourly_event');
    }
    
    function do_this_hourly() {
    	update_option('makeoption', date('Y-m-d H:i'));
    }

    [No bumping, thank you.]

The topic ‘wp_schedule_event’ is closed to new replies.