wp_schedule_event events don’t fire
-
I wrote a couple of plugins. The first one, on activate, sets up an event to fire tomorrow (the next day) at midnight (plus 1 minute). Here’s my code:
function plugin_activate() { updateUserScores(); wp_schedule_event(strtotime(date('Y-m-d 00:01:00', , strtotime("+1 day"))), 'daily', 'updateUserScores'); }
When I call
wp_next_scheduled('updateUserScores')
(and throw it through the PHP date function), it gives me the right timestamp. But when I visit the site, nothing happens. I don’t have any sort of caching installed.I’ve tried removing the +1 day to make it TODAY at midnight (i.e. a timestamp in the past); it still doesn’t fire my event. Not sure what’s going on …
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘wp_schedule_event events don’t fire’ is closed to new replies.