[wp-hackers] WordPress 2.1 Cron Examples
Glenn Slaven
glenn at slaven.net.au
Wed Feb 7 09:33:27 GMT 2007
Austin Matzko wrote:
> On 1/21/07, Lester Chan <gamerz84 at hotmail.com> wrote:
>> Hi Guys,
>> I intending to use the inbuilt cron feature of wordpress 2.1 but i
>> can't find any examples of it.
>>
>> I tried the following code, but it will not work. Any ideas?
>
> Could the problem be that you're scheduling the first event to be
> right now (using time() ), instead of in the future? It may be that
> by the time the event gets scheduled, it's already in the past, so you
> would need to wait an hour for the next interval to occur.
> _______________________________________________
Lester, I know this is a bit late, so disregard this if you've already
found the solution
it would be a good idea to do a print_r(wp_next_scheduled('test')); just
to make sure that it hasn't gotten itself scheduled when you were
testing something earlier, also try renaming your hook and your function
to something else, just in calse there is a name colision. There would
be no error reported if there was, it would just do nothing.
I've got a *fairly* extensive post on how to schedule events in 2.1
here:
http://blog.slaven.net.au/archives/2007/02/01/timing-is-everything-scheduling-in-wordpress/
. You seem to know what you're doing anyway, but there may be something
in there that's a help.
cheers
Glenn Slaven
http://www.slaven.net.au/
More information about the wp-hackers
mailing list