[wp-hackers] Using WP cron from mu-plugins

Ryan McCue lists at rotorised.com
Fri Aug 24 01:36:37 UTC 2012


Harry Metcalfe wrote:
> Does anyone know of a better way to do it?

Another option would be to hook into an existing cron task that you know
will be wrong; say, the core update check (wp_version_check). Then,
check if your task has been added. If not, run it immediately and
schedule your new task. That gives you a maximum wait between when you
enable the plugin and when the task starts of the update checking time
(which is twicedaily).

Alternatively, hook into an admin hook and check there. Saves you
running it on every request, but is still run fairly often.

-- 
Ryan McCue
<http://ryanmccue.info/>


More information about the wp-hackers mailing list