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

WordPress Trac noreply at wordpress.org
Fri Jun 20 19:29:39 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:
Component:  Query            |     Version:
 Severity:  normal           |  Resolution:  wontfix
 Keywords:  has-patch        |     Focuses:
-----------------------------+-----------------------------

Comment (by pglewis):

 I still support the spirit of this issue and the proposed fix, FWIW.

 This is a case of undefined behavior. The `WP_Query` docs do not specify
 the behavior of the `post__in` parameter if it is set but falsey.  Our
 usage in Pods was based on empirical research; the docs don't say you can
 use it that way but they also don't specify that you can't.  Integrators
 shouldn't be shocked when something that relies on undefined behavior
 breaks.

 I still think it's fine to change this if it is explicitly documented in
 the codex how the affected parameters will behave in all situations.

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


More information about the wp-trac mailing list