Ticket #12891: scale.12891.6b.diff
File scale.12891.6b.diff, 950 bytes (added by , 15 years ago) |
---|
-
wp-includes/taxonomy.php
542 542 return ' AND 0 = 1'; 543 543 } 544 544 545 if ( !in_array( $operator, array( 'IN', 'NOT IN' ) ) )546 $operator = 'IN';547 548 545 $taxonomies = "'" . implode( "', '", $taxonomies ) . "'"; 549 546 550 547 $terms = array_unique( (array) $terms ); … … 587 584 588 585 $i++; 589 586 } 590 else { 591 // NOT IN is very slow for some reason 592 $where .= " AND $primary_table.$primary_id_column IN ( 593 SELECT object_id 594 FROM $wpdb->term_relationships 595 WHERE term_taxonomy_id $operator ($terms) 587 elseif ( 'NOT IN' == $operator ) { 588 $where .= " AND $primary_table.$primary_id_column NOT IN ( 589 SELECT object_id 590 FROM $wpdb->term_relationships 591 WHERE term_taxonomy_id IN ($terms) 596 592 )"; 597 593 } 598 594 } 599 600 595 return compact( 'join', 'where' ); 601 596 } 602 597