[wp-hackers] Cron? Anyone?

Peter Westwood peter.westwood at ftwr.co.uk
Fri Apr 7 14:30:07 GMT 2006


On Fri, April 7, 2006 3:03 pm, Owen Winkler wrote:
> Hi folks, simple question:
>
> Where in the 2.1 source is wp_cron() called?  wp_cron() being the
function that primes the cron engine by calling spawn_cron().  And
spawn_cron() creates a socket to request wp-cron.php, which executes the
hooks that have expired timestamps.
>
> At this point, having written a few posts on 2.1, I would expect that I
would see a couple of "wp-cron.php" entries in my apache logs, since
various things are set to happen via wp-cron (like pinging) when you
post a new entry.
>
> Maybe I'm blind?  Or was there something I was supposed to do to enable
this?

Scanning through my local phpxref'd copy of the trunk source it looks like
wp-cron is called on the "init" hook if we are currently not already doing
cron (see /wp-includes/default-filters.php lines 89-90).

Whether or not anything currently uses cron is another question.
Looking around there does seem to be a number of references to
wp_schedule_single_event - notably for pings and future posts.

I've just tried a future post on my test blog - now I wait to see if it
turns up....

westi
-- 
Peter Westwood <peter.westwood at ftwr.co.uk>
http://blog.ftwr.co.uk





More information about the wp-hackers mailing list