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

WordPress Trac noreply at wordpress.org
Wed Dec 19 15:06:43 UTC 2018


#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 davidlabbe00):

 I posted a work around to this issue a couple years ago here:
 https://wordpress.stackexchange.com/questions/140692/can-i-force-wp-query-
 to-return-no-results/140727#140727

 Basically if use the code below it will return no results or no post which
 is what you would expect.
 {{{
 'post__in' => array(0)
 }}}

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


More information about the wp-trac mailing list