From 13058d536e17994464141d9607b8ecc6b7668d70 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 8 Mar 2011 22:01:19 +0000 Subject: [PATCH] Don't perform taxonomy queries for single post requests. Props scribu. fixes #16793 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@17504 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 3389232e08..95ecb7a640 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2150,12 +2150,14 @@ class WP_Query { $search = apply_filters_ref_array('posts_search', array( $search, &$this ) ); // Taxonomies - $this->parse_tax_query( $q ); + if ( !$this->is_singular ) { + $this->parse_tax_query( $q ); - $clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' ); + $clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' ); - $join .= $clauses['join']; - $where .= $clauses['where']; + $join .= $clauses['join']; + $where .= $clauses['where']; + } if ( $this->is_tax ) { if ( empty($post_type) ) {