Changeset 41377 for trunk/src/wp-includes/class-wp-term-query.php
- Timestamp:
- 09/13/2017 02:47:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-term-query.php
r41162 r41377 552 552 } 553 553 554 $do_distinct = false; 555 556 /* 557 * Duplicate terms are generally removed when necessary after the database query. 558 * But when a LIMIT clause is included in the query, we let MySQL enforce 559 * distinctness so the count is correct. 560 */ 561 if ( ! empty( $limits ) && 'all_with_object_id' !== $args['fields'] ) { 562 $do_distinct = true; 563 } 554 564 555 565 if ( ! empty( $args['search'] ) ) { … … 569 579 $join .= $mq_sql['join']; 570 580 $this->sql_clauses['where']['meta_query'] = preg_replace( '/^\s*AND\s*/', '', $mq_sql['where'] ); 571 $distinct .= "DISTINCT"; 572 581 $do_distinct = true; 573 582 } 574 583 … … 632 641 $where = implode( ' AND ', $this->sql_clauses['where'] ); 633 642 643 $distinct = $do_distinct ? 'DISTINCT' : ''; 644 634 645 /** 635 646 * Filters the terms query SQL clauses.
Note: See TracChangeset
for help on using the changeset viewer.