WP_Cron troubles
-
I’m creating my own plugin to schedule a cron job, and it’s working TOO well. It fires every time my site is hit, not when it’s scheduled. I’ve used the Debug Bar plugin with the Cron plugin, and it shows:
NEXT EVENT:
2013-11-04 15:35:37
1383579337
23 hours agoIt consistently says that the next event is in the past. Any ideas?
add_action('admin_menu', 'dhg_cron_menu'); function dhg_cron_menu() { add_options_page('NEW WPMS Stats', 'NEW WPMS Stats', 'manage-options', 'dhg-cron', 'dhg_cron_settings'); } function dhg_cron_settings() { if(!wp_next_scheduled('dhg_cron_hook')) { wp_schedule_event(time(), 'hourly', 'dhg_cron_hook'); } } add_action('dhg_cron_hook', 'dhg_cron_get_stats'); function dhg_cron_get_stats() { log_wpms_stats("testing!"); }
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘WP_Cron troubles’ is closed to new replies.