[wp-hackers] WordPress 2.1 Cron Examples
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
. You seem to know what you're doing anyway, but there may be something
in there that's a help.
More information about the wp-hackers