[wp-hackers] Scheduling of future posts with a different post_type.

Jason Webster jason at intraffic.net
Mon Jul 14 16:43:12 GMT 2008


And there's my problem.
Well, not really. Very easy fix.

I just need to register a new action with my post_type.

Thanks a ton, Otto.

Otto wrote:
> On Mon, Jul 14, 2008 at 10:47 AM, Jason Webster <jason at intraffic.net> wrote:
>   
>> After manually monitoring the cron array, it can definitively say it is just
>> not getting added to it at all.
>>
>> Now, my question is, where in wp_write_post(), wp_insert_post(), or anywhere
>> else for that matter, does the future publishing of a post get scheduled?? I
>> can't seem to find it. Sorry if it's obvious.
>>     
>
> It's not that obvious, actually.
>
> wp_insert_post() calls wp_transition_post_status(), and the
> wp_transition_post_status function does this:
> do_action("${new_status}_$post->post_type", $post->ID, $post);
>
> This is hooked by these:
> add_action('future_post', '_future_post_hook', 5, 2);
> add_action('future_page', '_future_post_hook', 5, 2);
>
> Which then calls this:
> function _future_post_hook($deprecated = '', $post) {
> 	wp_clear_scheduled_hook( 'publish_future_post', $post->ID );
> 	wp_schedule_single_event(strtotime($post->post_date_gmt. ' GMT'),
> 'publish_future_post', array($post->ID));
> }
>
> And there you go.
> _______________________________________________
> 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