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

WordPress Trac noreply at wordpress.org
Thu Aug 10 09:06:01 UTC 2023


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

 I just noticed today after updating WordPress to Version 6.3 that the
 post__in array(0) hack no longer works, but rather shows all posts just
 like the empty array. My workaround this time was to change the post_type
 to something_that_does_not_exist in the case that the list given to
 post__in would be empty.

 I'm betting there's quite a number of sites using the zero array hack that
 now are showing content their developers don't want some viewers to see,
 and this could lead to some legal action if it was used to segregate or
 hide content that's confidential or private to those users or groups.

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


More information about the wp-trac mailing list