Scheduling in WordPress 2.1

WordPress 2.1 brought with it a number of new features, one of which is a pseudo-cron scheduling framework.  This has been is the pipes for some time now, Scott Merrill developed a plugin called wp-cron back in 2005. After the 2.0 release of WordPress, there was a discussion on the wp-hackers mailing list about getting […]

WordPress 2.1 brought with it a number of new features, one of which is a pseudo-cron scheduling framework.  This has been is the pipes for some time now, Scott Merrill developed a plugin called wp-cron back in 2005. After the 2.0 release of WordPress, there was a discussion on the wp-hackers mailing list about getting a cron-type scheduling feature into the core of WordPress and the functionality that was released with 2.1 started to take shape.

One of the more important points to come out of this discussion was that this was not meant to replace the actual cron feature built into the Linux operating system, it is not meant to be anywhere near that precise

As for the precision, perhaps the minutely thing might be a little much (mostly cause it’s hard to guarantee a hit every single minute of the day.) but I would still leave that in with a warning to authors that a * rules on the minute option is not likely to work — it’d still be handy, though, for every hour, on the hour.

What has been produced is a system that allows plugin developers to schedule events to occur at certain times.  It does this by checking the current time against the list of scheduled tasks every time a page is loaded on the site.  If the set time has passed the task (a callback function) is done. 

Getting the scheduling to do what it should is going to require a working knowledege of how WordPress hooks, actions & filters work.  If you don’t here is some recommended reading, It’s recommend you appraise yourself of this information before proceeding further. 

Contine to read How to schedule a task

WordPress, Cron, Scheduling