[wp-trac] [WordPress Trac] #27507: get_posts() not honoring post_status criteria

WordPress Trac noreply at wordpress.org
Wed Apr 23 17:25:01 UTC 2014


#27507: get_posts() not honoring post_status criteria
-------------------------------+--------------------
 Reporter:  Denis-de-Bernardy  |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  4.0
Component:  Query              |     Version:  3.8.1
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+--------------------
Changes (by Denis-de-Bernardy):

 * keywords:  has-patch needs-unit-tests =>


Comment:

 The patch you uploaded seems invalid. If you opt to ignore status
 validation in early calls to `get_posts()`, the patch should probably be
 more like:

 {{{
 if ( empty( $stati ) ) {
     foreach ($q_status as $status) {
         ...
     }
 }
 }}}

 (And I still think a `_doing_it_wrong()` call is more appropriate here.

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


More information about the wp-trac mailing list