diff --git a/wp-includes/query.php b/wp-includes/query.php
index 04286aa..625a4fa 100644
a
|
b
|
class WP_Query { |
1753 | 1753 | $q['cat'] = implode(',', $req_cats); |
1754 | 1754 | } |
1755 | 1755 | |
1756 | | if ( !empty($q['category__in']) ) { |
1757 | | $q['category__in'] = array_map('absint', array_unique( (array) $q['category__in'] ) ); |
| 1756 | if ( ! empty( $q['category__and'] ) && 1 === count( (array) $q['category__and'] ) ) { |
| 1757 | $q['category__and'] = (array) $q['category__and']; |
| 1758 | if ( ! isset( $q['category__in'] ) ) |
| 1759 | $q['category__in'] = array(); |
| 1760 | $q['category__in'][] = absint( reset( $q['category__and'] ) ); |
| 1761 | unset( $q['category__and'] ); |
| 1762 | } |
| 1763 | |
| 1764 | if ( ! empty( $q['category__in'] ) ) { |
| 1765 | $q['category__in'] = array_map( 'absint', array_unique( (array) $q['category__in'] ) ); |
1758 | 1766 | $tax_query[] = array( |
1759 | 1767 | 'taxonomy' => 'category', |
1760 | 1768 | 'terms' => $q['category__in'], |
… |
… |
class WP_Query { |
1763 | 1771 | ); |
1764 | 1772 | } |
1765 | 1773 | |
1766 | | if ( !empty($q['category__not_in']) ) { |
1767 | | $q['category__not_in'] = array_map('absint', array_unique( (array) $q['category__not_in'] ) ); |
| 1774 | if ( ! empty($q['category__not_in']) ) { |
| 1775 | $q['category__not_in'] = array_map( 'absint', array_unique( (array) $q['category__not_in'] ) ); |
1768 | 1776 | $tax_query[] = array( |
1769 | 1777 | 'taxonomy' => 'category', |
1770 | 1778 | 'terms' => $q['category__not_in'], |
… |
… |
class WP_Query { |
1773 | 1781 | ); |
1774 | 1782 | } |
1775 | 1783 | |
1776 | | if ( !empty($q['category__and']) ) { |
1777 | | $q['category__and'] = array_map('absint', array_unique( (array) $q['category__and'] ) ); |
| 1784 | if ( ! empty($q['category__and']) ) { |
| 1785 | $q['category__and'] = array_map( 'absint', array_unique( (array) $q['category__and'] ) ); |
1778 | 1786 | $tax_query[] = array( |
1779 | 1787 | 'taxonomy' => 'category', |
1780 | 1788 | 'terms' => $q['category__and'], |