WordPress 1.5 plug-in: view future posts
At Starling Fitness we write many of the posts a few days in advance, which makes it much easier to ensure that we meet our goal of at least one post a day. WordPress lets you publish posts with future dates, and they stay invisible until their time comes. Unfortunately, you can’t view these future posts (except in the editor preview), and we like to see them as they will appear, complete with the site’s styles. So, I installed a Cheesy Hack(tm) a while ago to allow administrators to view future posts just like current ones.
I was working on a WordPress 1.5 version of the Cheesy Hack, and stumbled across a plug-in hook—so I realized I could write a proper plug-in instead. So here it is:
- Download futureposts.php.txt (WordPress 1.5 plug-in)
With this plug-in, an administrator can view future posts at their permalink, so the View links in the administration panel work just like regular posts. The posts only appear at their permalink page—they are omitted from the home page, archives pages, category pages, and RSS feeds. You can modify two variables to change these behaviors:
- $future_min_level—the minimum user level required to view future posts. The default is 10 (administrators). Set this to zero to allow everyone (even anonymous users) to view future posts.
- $future_single_only—if set to true (default), future posts are available from their unique permalink only. If set to false, future posts appear on the categories, archives, and the home page.
To install the plug-in: (WordPress 1.5 only) Download the file, rename it to futureposts.php, save it in your wp-content/plugins directory, then activate it from the administration Plugins page. That’s it!
This is my first attempt at a WordPress plug-in, so please let me know if you’ve found it useful, if it’s not behaving as you expected, or if you have a feature suggestion. Enjoy!
Update 7/20/2005: I’ve written an Enhanced Post Management plugin that adds additional features you might find useful for managing future posts.

function eventcalendarfilterwhere($where) { // Eliminate date restrictions if the query is day- or category- specific. global $wpquery; if($wpquery->isday || $wpquery->iscategory) return pregreplace("/AND +postdategmt *<= *'[-: 0-9]+' +/",'',$where); else return $where; } addfilter('postswhere','eventcalendarfilterwhere');This filter removes the ‘postdategmt’ restriction from the WHERE clause, but only if the query is specific to a particular day or a category. That cheats a little bit – it would be better to only remove the restriction if the query was for the specific event category – but I opted for an easier user interface. Plugin homepage: http://blog.firetree.net/2005/05/24/eventcalendar2/‘.+’, and now all works fine.