mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 09:07:59 +01:00
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
This commit is contained in:
parent
15889b6397
commit
20b1b2098a
@ -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)";
|
||||
}
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user