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

WordPress Trac noreply at wordpress.org
Fri Jun 20 22:18:57 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 DrewAPicture):

 Replying to [comment:22 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.

 See #25367 for incoming work on documenting individual `WP_Query`
 arguments.

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


More information about the wp-trac mailing list