[wp-trac] [WordPress Trac] #32322: Custom permalink structure incorrect for Future posts

WordPress Trac noreply at wordpress.org
Fri Jun 5 15:43:06 UTC 2015


#32322: Custom permalink structure incorrect for Future posts
-------------------------------------------------+-------------------------
 Reporter:  greencode                            |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Permalinks                           |  Review
 Severity:  normal                               |     Version:  4.2
 Keywords:  good-first-bug needs-unit-tests      |  Resolution:
  has-patch                                      |     Focuses:
-------------------------------------------------+-------------------------

Comment (by kdoole):

 @kreatif, formatting the permalink is one thing, but enabling non-logged
 in users to view future posts is another. I did a very quick search and
 found [https://wordpress.org/plugins/show-future-posts-on-single-post/
 this plugin], which seems to work by doing the following:
 {{{
 add_filter( 'the_posts', 'show_future_posts' );
 function show_future_posts( $posts ) {
    global $wp_query, $wpdb;

    if ( is_single() && $wp_query->post_count == 0 ) {
       $posts = $wpdb->get_results( $wp_query->request );
    }

    return $posts;
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32322#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list