Make WordPress Core


Ignore:
Timestamp:
04/12/2016 08:36:31 PM (9 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-tax-query.php

    r35916 r37184  
    441441                $clause['alias'] = $alias;
    442442
    443                 $join .= " INNER JOIN $wpdb->term_relationships";
     443                $join .= " LEFT JOIN $wpdb->term_relationships";
    444444                $join .= $i ? " AS $alias" : '';
    445445                $join .= " ON ($this->primary_table.$this->primary_id_column = $alias.object_id)";
Note: See TracChangeset for help on using the changeset viewer.