[wp-trac] [WordPress Trac] #18264: Future private posts listed as already published with future date specified

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 2 16:50:31 UTC 2012


#18264: Future private posts listed as already published with future date specified
-------------------------------------------------+-------------------------
 Reporter:  chrisrudzki                          |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Administration                       |  Review
 Severity:  normal                               |     Version:
 Keywords:  needs-patch ux-feedback ui-feedback  |  Resolution:
-------------------------------------------------+-------------------------

Comment (by scribu):

 My quick-fix for not showing future private posts on the front-end:

 {{{
 function fix_future_private( $sql, $wp_query ) {
         global $wpdb;

         $sql .= $wpdb->prepare( " AND $wpdb->posts.post_date <= %s",
 current_time('mysql') );

         return $sql;
 }

 if ( !is_admin() )
         add_filter( 'posts_where', 'fix_future_private', 10, 2 );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18264#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list