From 20b1b2098aac70f058738a714d96ef8f65ffedb7 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Tue, 12 Apr 2016 20:37:26 +0000 Subject: [PATCH] Use `LEFT JOIN` when building `WP_Tax_Query` SQL. `LEFT JOIN` ensures that `NOT EXISTS` queries will not miss posts that have no taxonomy data whatsoever. Props swissspidy, crstauf. Fixes #36343. Built from https://develop.svn.wordpress.org/trunk@37184 git-svn-id: http://core.svn.wordpress.org/trunk@37151 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-tax-query.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-tax-query.php b/wp-includes/class-wp-tax-query.php index a842b2c3fe..e220806401 100644 --- a/wp-includes/class-wp-tax-query.php +++ b/wp-includes/class-wp-tax-query.php @@ -440,7 +440,7 @@ class WP_Tax_Query { // Store the alias with this clause, so later siblings can use it. $clause['alias'] = $alias; - $join .= " INNER JOIN $wpdb->term_relationships"; + $join .= " LEFT JOIN $wpdb->term_relationships"; $join .= $i ? " AS $alias" : ''; $join .= " ON ($this->primary_table.$this->primary_id_column = $alias.object_id)"; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 77d06d59fc..a48c143b5a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37183'; +$wp_version = '4.6-alpha-37184'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.