Ticket #12891: scale.12891.6.diff
| File scale.12891.6.diff, 862 bytes (added by scribu, 3 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 ( 587 elseif ( 'NOT IN' == $operator ) { 588 $where .= " AND $primary_table.$primary_id_column NOT IN ( 593 589 SELECT object_id 594 590 FROM $wpdb->term_relationships 595 WHERE term_taxonomy_id $operator ($terms)596 )"; 591 WHERE term_taxonomy_id IN ($terms) 592 )"; 597 593 } 598 594 } 599 595