[wp-hackers] wp_cron - odd behavior

Jeremy Clarke jer at simianuprising.com
Sat Feb 19 20:13:03 UTC 2011

On Sat, Feb 19, 2011 at 12:43 PM, Otto <otto at ottodestruct.com> wrote:

> This has implications that most people might not realize.. Because if
> I schedule an event for 1970 (zero), I'm now unable to schedule the
> identical event for any time after 1970... If your events are wholly
> identical, then you will have trouble scheduling more than one of them
> unless your timing is tricky. In such cases, you should use a periodic
> event using wp_schedule_event instead.
This makes me think of another idea: If you are scheduling multiple similar
events it might work better to only schedule the earlier one at first, then
add the later events during your hooked function on the first one. I don't
have experience with the complicated situation Otto is talking about, but it
sounds like only scheduling one event at a time might be a workaround that
isn't *too* hacky. It would also protect you from other types of bug since
you could make sure the latter event is still valid before scheduling it
when the first one fires.

Jeremy Clarke • jeremyclarke.org
Code and Design • globalvoicesonline.org

More information about the wp-hackers mailing list