cron wp_schedule_event
-
I can’t get wordpress’ cronjob work:
Here what I have done:
<?php function hlex_install() { wp_schedule_event(time(), 'hourly', 'hlex_timing_job'); } function hlex_cronjob() { die('cronjob'); } function hlex_deactivation() { wp_clear_scheduled_hook('hlex_timing_job'); } register_activation_hook(__FILE__, 'hlex_install'); register_deactivation_hook(__FILE__, 'hlex_deactivation'); add_action('hlex_timing_job', 'hlex_cronjob'); ?>
The wp_schedule_event works cause I can see in the table wp_options (option_name=’cron’ ) something like: i:1270343829;a:1:{s:15:”hlex_timing_job”;
wp_clear_scheduled_hook works too because if I deactivate the plugin “hlex_timing_job” has gone from the “cron” row of the wp_options table.
The problem is that hlex_cronjob() is never executed or at least I’ve never seen the word ‘cronjob’ printed.
I hope someone can help me.
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘cron wp_schedule_event’ is closed to new replies.