[wp-hackers] Using WP cron from mu-plugins
Harry Metcalfe
harry at dxw.com
Thu Aug 23 17:01:42 UTC 2012
Hmm -- won't that run for every admin request?
H
On 23/08/12 17:25, John Blackbourn wrote:
> 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.
> See http://lists.automattic.com/pipermail/wp-hackers/2011-December/041917.html
>
> John
> _______________________________________________
> 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