Ticket #16152: 16152.diff
File 16152.diff, 2.2 KB (added by , 14 years ago) |
---|
-
wp-includes/query.php
1231 1231 var $is_post_type_archive = false; 1232 1232 1233 1233 /** 1234 * Whether the tax query has been parsed once. 1235 * 1236 * @since 3.1.0 1237 * @access private 1238 * @var bool 1239 */ 1240 var $parsed_tax_query = false; 1241 1242 /** 1234 1243 * Resets query flags to false. 1235 1244 * 1236 1245 * The query flags are what page info WordPress was able to figure out. … … 1485 1494 $this->is_date = true; 1486 1495 } 1487 1496 1497 $this->parsed_tax_query = false; 1488 1498 $this->parse_tax_query( $qv ); 1489 1499 1490 1500 foreach ( $this->tax_query->queries as $tax_query ) { … … 1671 1681 } 1672 1682 1673 1683 // Category stuff 1674 if ( !empty($q['cat']) && '0' != $q['cat'] && !$this->is_singular ) {1684 if ( !empty($q['cat']) && '0' != $q['cat'] && !$this->is_singular && !$this->parsed_tax_query ) { 1675 1685 $q['cat'] = ''.urldecode($q['cat']).''; 1676 1686 $q['cat'] = addslashes_gpc($q['cat']); 1677 1687 $cat_array = preg_split('/[,\s]+/', $q['cat']); … … 1684 1694 $cat = abs($cat); 1685 1695 if ( $in ) { 1686 1696 $q['category__in'][] = $cat; 1697 $q['category__in'] = array_merge( $q['category__in'], get_term_children($cat, 'category') ); 1687 1698 } else { 1688 1699 $q['category__not_in'][] = $cat; 1700 $q['category__not_in'] = array_merge( $q['category__not_in'], get_term_children($cat, 'category') ); 1689 1701 } 1690 1702 } 1691 1703 $q['cat'] = implode(',', $req_cats); … … 1696 1708 $tax_query[] = array( 1697 1709 'taxonomy' => 'category', 1698 1710 'terms' => $q['category__in'], 1699 'field' => 'term_id' 1711 'field' => 'term_id', 1712 'include_children' => false 1700 1713 ); 1701 1714 } 1702 1715 … … 1705 1718 $tax_query[] = array( 1706 1719 'taxonomy' => 'category', 1707 1720 'terms' => $q['category__not_in'], 1708 'operator' => 'NOT IN' 1721 'operator' => 'NOT IN', 1722 'include_children' => false 1709 1723 ); 1710 1724 } 1711 1725 … … 1715 1729 'taxonomy' => 'category', 1716 1730 'terms' => $q['category__and'], 1717 1731 'field' => 'term_id', 1718 'operator' => 'AND' 1732 'operator' => 'AND', 1733 'include_children' => false 1719 1734 ); 1720 1735 } 1721 1736 … … 1773 1788 ); 1774 1789 } 1775 1790 1791 $this->parsed_tax_query = true; 1792 1776 1793 $this->tax_query = new WP_Tax_Query( $tax_query ); 1777 1794 } 1778 1795