[wp-trac] [WordPress Trac] #34325: get_posts seems to have issues including posts "published in the past"

WordPress Trac noreply at wordpress.org
Fri Oct 16 14:53:36 UTC 2015


#34325: get_posts seems to have issues including posts "published in the past"
-------------------------------+-----------------------------
 Reporter:  kevingimbel        |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  4.3
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 We just notices a potential bug with the `get_posts` function.

 At out site we use it in a simple `recent-post` shotcode to get recent
 posts. The exact "query" is below.

 {{{
 get_posts(
     array(
       'orderby' => 'date',
       'order' => 'DESC',
       'post_type' => 'post',
       'showposts' => 3,
       'post_status' => 'publish'
     )
   );
 }}}

 However, when we published an article today and marked it as "Published in
 September" the post didn't show up. Strangely, it showed up when logged in
 to the backend.

 '''Workaround:''' A quick workaround was to create a new post and
 immediately delete it, then the "old" posts would show up.

 The general post list did show the posts correctly all the time.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34325>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list