1399,1415d1398 < //Custom Taxonomies < foreach( $qv as $var => $value ) { < if( ( $pos = strpos( $var, '__in' ) ) && $var != 'tag__in' && $var != 'category__in' && $var != 'post__in' && $var != 'tag_slug__in' ) { < $custom_taxonomies[ $var ] = substr( $var, 0, $pos ); < } < elseif( ( $pos = strpos( $var, '__not_in' ) ) && $var != 'tag__not_in' && $var != 'category__not_in' && $var != 'post__not_in' ) { < (array) $this->custom_taxonomies__not_in[ $var ] = substr( $var, 0, $pos ); < } < } < < foreach( (array) $custom_taxonomies as $var => $custom_tax ) { < $item = 'is_' . $custom_tax; < $this->$item = true; < (array) $qv[$var]; < } < $this->custom_taxonomies = (array) $custom_taxonomies; < 1922,1940c1905 < //Custom Taxonomies < foreach( (array) $this->custom_taxonomies as $var => $custom_tax ) { < $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) "; < $reqtag = is_term( $q[$var][0], $custom_tax ); < $distinct = 'DISTINCT'; < } < < //Custom Taxonomy Not In < foreach( (array) $this->custom_taxonomies__not_in as $var => $custom_tax ) { < if ( $wpdb->has_cap( 'subqueries' ) ) { < $tax_string = "'" . implode("', '", $q[$var]) . "'"; < $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = '$custom_tax' AND tt.term_id IN ($tax_string) )"; < } else { < $ids = get_objects_in_term($q[$var], $custom_tax); < if ( !is_wp_error($ids) && is_array($ids) && count($ids) > 0 ) < $whichcat .= " AND $wpdb->posts.ID NOT IN ('" . implode("', '", $ids) . "')"; < } < } < < // Tag and slug intersections. Also merge with custom taxonomies --- > // Tag and slug intersections. 1942d1906 < $intersections = array_merge( $intersections, (array) $this->custom_taxonomies ); 1945a1910 > if ( in_array($item, $tagin) && empty($q['cat']) ) continue; // We should already have what we need if categories aren't being used 1953c1918 < $taxonomy_field = $item != ('tag_slug__and' || 'tag_slug__in') ? 'slug' : 'term_id'; --- > $taxonomy_field = $item == ('tag_slug__and' || 'tag_slug__in') ? 'slug' : 'term_id';