[wp-trac] [WordPress Trac] #15350: WP_Query Assumes Taxonomy Query Operator

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 9 14:52:33 UTC 2010


#15350: WP_Query Assumes Taxonomy Query Operator
--------------------------+-------------------------------------------------
 Reporter:  filosofo      |        Owner:  filosofo
     Type:  defect (bug)  |       Status:  reopened
 Priority:  normal        |    Milestone:  3.1     
Component:  Query         |      Version:  3.1     
 Severity:  normal        |   Resolution:          
 Keywords:                |  
--------------------------+-------------------------------------------------

Comment(by filosofo):

 What can't you reproduce?  The 3.0 behavior or trunk behavior?

 r163258 is the proximate cause, because prior to that the above query has
 no operator set (that's what this ticket is about).

 From `wp-includes/query.php`:

 {{{
 1576                 foreach ( $q['tax_query'] as $query ) {
 1577                         if ( 'IN' == $query['operator'] ) {
 1578                                 switch ( $query['taxonomy'] ) {
 1579                                         case 'category':
 1580                                                 $this->is_category =
 true;
 1581                                                 break;
 1582                                         case 'post_tag':
 1583                                                 $this->is_tag = true;
 1584                                                 break;
 1585                                         default:
 1586                                                 $this->is_tax = true;
 1587                                 }
 1588                         }
 1589                 }
 }}}

 According to the above, if the `operator` isn't `IN`, then `is_category`
 and `is_tag` will not be true.

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


More information about the wp-trac mailing list