[wp-trac] [WordPress Trac] #24351: post__not_in is ignored in WP_Query

WordPress Trac noreply at wordpress.org
Sat May 18 08:42:20 UTC 2013


#24351: post__not_in is ignored in WP_Query
--------------------------+----------------------
 Reporter:  Dukessa       |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Query         |     Version:  3.5.1
 Severity:  normal        |  Resolution:  invalid
 Keywords:  needs-codex   |
--------------------------+----------------------
Changes (by SergeyBiryukov):

 * keywords:   => needs-codex


Comment:

 Thanks for adding the note to Codex.

 Note that it's not just `post__not_in`, this applies other `*__in` and
 `*__not_in` query vars too. They expect a proper array of integers, not a
 comma-separated string or a mix of both.

 Replying to [comment:2 nacin]:
 > You need to do one or the other: an array of IDs, or comma-separated
 IDs.

 Actually, `post__not_in` and other `*__in` and `*__not_in` query vars only
 accept an array: [source:tags/3.5.1/wp-includes/query.php#L2163].

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24351#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list