[wp-trac] [WordPress Trac] #14892: minor improvement on category__in

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 7 21:21:27 UTC 2011

#14892: minor improvement on category__in
 Reporter:  sboisvert                 |       Owner:  scribu
     Type:  enhancement               |      Status:  reopened
 Priority:  normal                    |   Milestone:  3.1
Component:  Query                     |     Version:  3.1
 Severity:  minor                     |  Resolution:
 Keywords:  query, reporter-feedback  |

Comment (by sboisvert):

 Just to make it easier for someone else who can actually fix the problem,
 it seems to be related to the fact that
 parses categories differently than tags/tax, the logic that was added for
 this in line 1695 is as follows:
 $q['category__in'] = array_unique( $q['category__in'] );
 Which seems to be different than the one in [15626], in that the one in
 [15626] casts as an array and then traverses and casts the values of the
 array as ints:
 $qv['category__in'] = array_map('absint', (array) $qv['category__in']);

 I suspect the behavior in [15626] might be the better one, but I wouldn't
 be able to say anything with any certainty if there is any valid reason
 why it was not implemented this way.

 Thank you,

Ticket URL: <http://core.trac.wordpress.org/ticket/14892#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list