[wp-hackers] Allowing future posts

Ryan Boren ryan at boren.nu
Sun Nov 18 20:01:07 GMT 2007


On 11/18/07, Hacker Scot <shacker at birdhouse.org> wrote:
> > Date: Sat, 17 Nov 2007 15:00:12 -0500
> > From: Kaf Oseo <kaf at szub.net>
> > Subject: Re: [wp-hackers] Allowing future posts
>
> > Did I claim it would be trivial? Bugger...
> >
> > Ok Scot, this *even more* simplistic version seems to work
> > everywhere. I
> >   know because I actually bothered to test it this time!
> >
> > -Kaf
>
> So close and yet so far. This version fixes that bug (thanks!), but
> now future posts are only available when logged in, not to the public.
> One more pass? :)

Off the top off my head, untested:

function setup_future_hook() {
  remove_action('future_post', '_future_post_hook');
  add_action('future_post', 'publish_future_post_now');
}

function publish_future_post_now($id) {
  wp_publish_post($id);
}

add_action('init', 'setup_future_hook');


More information about the wp-hackers mailing list