Future Post

One of WordPress’ little-used features is its ability to set a “drip date” – to set a post’s timestamp in the future so that it doesn’t go live on the site until that time comes around. Recently I was working on a site for a client who needed an Events section. For various reasons, I didn’t want to use any of the existing events plugins for WP – I just wanted to override the behavior for future-dated posts so that they’d go live on the site immediately, without waiting.

For the past year or so, I’ve virtually never found a case where anything I wanted to do with WP hadn’t already been solved by an existing plugin or tweak to template logic. But amazingly, I couldn’t find anything to override the default future post behavior. Posted on WP-Hackers about the problem and got a few solutions volunteered within a few hours (there’s nothing like a vibrant open source community). By far the most elegant was this one from the magical Ryan Boren (same guy who planted the semi-secret WordPress t-shirt geocache):

Stick this in a php document in your plugins folder (remember not to include any whitespace after the closing php tag!), activate it, and create a post with a future timestamp. The post’s status field in wp_posts will be set to “publish” rather than “future” and it’ll go live on the site immediately.

You can also download this as a ready-to-go plugin.

Ryan’s too busy to host this trivial but super-useful plugin himself, but invited me to. I’ve submitted it to WP-Plugins and am awaiting a response – should be available there as well before long.

Music: Daniel Mille :: Les Minots

Leave a Reply

Your email address will not be published. Required fields are marked *