Changeset 41880 for trunk/src/wp-includes/class-wp-term-query.php
- Timestamp:
- 10/16/2017 06:34:29 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-term-query.php
r41769 r41880 554 554 } 555 555 556 $do_distinct = false;557 558 /*559 * Duplicate terms are generally removed when necessary after the database query.560 * But when a LIMIT clause is included in the query, we let MySQL enforce561 * distinctness so the count is correct.562 */563 if ( ! empty( $limits ) && 'all_with_object_id' !== $args['fields'] ) {564 $do_distinct = true;565 }566 556 567 557 if ( ! empty( $args['search'] ) ) { … … 581 571 $join .= $mq_sql['join']; 582 572 $this->sql_clauses['where']['meta_query'] = preg_replace( '/^\s*AND\s*/', '', $mq_sql['where'] ); 583 $do_distinct = true; 573 $distinct .= "DISTINCT"; 574 584 575 } 585 576 … … 643 634 $where = implode( ' AND ', $this->sql_clauses['where'] ); 644 635 645 $distinct = $do_distinct ? 'DISTINCT' : '';646 647 636 /** 648 637 * Filters the terms query SQL clauses.
Note: See TracChangeset
for help on using the changeset viewer.