[wp-hackers] Using WP cron from mu-plugins
johnbillion+wp at gmail.com
Thu Aug 23 16:25:39 UTC 2012
On 23 August 2012 16:04, Harry Metcalfe <harry at dxw.com> wrote:
> We have a plugin in mu-plugins that needs to schedule a wp cron task. The
> recommended way to do this is from an activation hook, but (reasonably
> enough) mu-plugins don't have activation hooks.
> The only way around this that I can think of is to have something check if
> the task is scheduled, and if it's not, schedule it. But that means we have
> to check for the task on every request, which sucks.
> Does anyone know of a better way to do it?
You're better off running your install/upgrade routinse on the admin_init hook.
More information about the wp-hackers