[wp-trac] [WordPress Trac] #43747: $query set post__not_in not accepting inputs from varaibles correctly

WordPress Trac noreply at wordpress.org
Thu Apr 12 14:36:38 UTC 2018


#43747: $query set post__not_in not accepting inputs from varaibles correctly
--------------------------+-----------------------------
 Reporter:  Venutius      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 If I enter:

 `$query->set('post__not_in', array(316,319,321));`

 posts 316, 319 and 321 are excluded from the loop.

 However, if I do:

 `$exclude_string = '316,319,321';`
 `$query->set('post__not_in', array($exclude_string));`

 Only post 316 is excluded. Can't see where I'd be doing something wrong
 here.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43747>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list