[wp-trac] [WordPress Trac] #28099: Empty array passed to WP_Query post__in returns posts

WordPress Trac noreply at wordpress.org
Thu May 29 06:03:17 UTC 2014


#28099: Empty array passed to WP_Query post__in returns posts
-----------------------------+-----------------------------
 Reporter:  danielbachhuber  |       Owner:  wonderboymusic
     Type:  defect (bug)     |      Status:  closed
 Priority:  normal           |   Milestone:  4.0
Component:  Query            |     Version:
 Severity:  normal           |  Resolution:  fixed
 Keywords:  has-patch        |     Focuses:
-----------------------------+-----------------------------
Changes (by wonderboymusic):

 * owner:   => wonderboymusic
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"28613"]:
 {{{
 #!CommitTicketReference repository="" revision="28613"
 If `post__in` or `post_parent__in` is passed to `WP_Query` as an empty
 array, nuke the query. Both vars are currently only checked for truthiness
 after which they are ignored. Setting these vars at all indicates explicit
 filtering being desired.

 Adds unit test.

 Fixes #28099.
 }}}

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


More information about the wp-trac mailing list