[wp-hackers] Pseudo-Cron

Otto otto at ottodestruct.com
Fri Sep 21 16:55:47 GMT 2007

Ahh, yes, you're correct about the arguments to
wp_clear_scheduled_hook. Never noticed that the used func_get_args()
there before now. Seems weird, given that the rest of the functions
work differently.

You're also correct about the arguments needing to be exact. The
arguments are used to build a key which is used internally by wp-cron.
Without the exact arguments, it won't find the entry in the cron
option array.

Thing is, I've never actually attempted to use wp-cron while passing
arguments to the functions before. Never had a need to do so.

Still, I expect that if you're the one to originally schedule the
event, you would arguably know the arguments you called it with and
therefore would be able to unschedule it as well.

On 9/21/07, Jennifer Hodgdon <yahgrp at poplarware.com> wrote:
> Otto --
> It looks like (from reading the code) for the unschedule, reschedule,
> and clear functions, you need to know the exact function arguments you
> originally created the schedule with (if any).  And for this function:
> > function wp_clear_scheduled_hook( $hook ) - Unschedules an event even
> > if you don't know when it's scheduled. This simply kills all events
> > that will trigger the given $hook. This is very useful.
> You actually call it with
>      wp_clear_scheduled_hook( $hook, $arg1, $arg2, ... )
> If you leave out the arguments, or they don't match, it looks to me as
> though the schedule will not be cleared.
> Correct?
>       Jennifer
> --
> Jennifer Hodgdon
> Poplar ProductivityWare * www.poplarware.com
> Web Databases/Scripts * Modeling/Analysis/Palm OS Software
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list