[wp-hackers] Allowing future posts

Kaf Oseo kaf at szub.net
Sun Nov 18 07:31:09 GMT 2007


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

<?php
/*
Plugin Name: The Future is Now!
Description: Display future timestamped posts.
Version: R1.0.2

h/t to Joost for the name!
*/

function show_future_where($where) {
	return str_replace('(post_status = \'publish\' OR post_status = 
\'private\')', '(post_status = \'publish\' OR post_status = \'private\' 
OR post_status = \'future\')', $where);
}

add_filter('posts_where', 'show_future_where');
?>

Hacker Scot wrote:
> This rocks, thanks much. But there's a bug - while it does allow future 
> posts to display now, when viewing a category page with this enabled, 
> the loop includes posts from outside the current category. Somehow it 
> breaks that part of the loop filter. Any tweaks you can suggest for that?
> 
> Thanks,
> ./s


More information about the wp-hackers mailing list