Revert taxonomy.php part of [16402]. Not fully backed yet. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16403 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
93b63b771c
commit
373717aeba
|
@ -593,15 +593,17 @@ function get_tax_sql( $tax_query, $object_id_column ) {
|
|||
}
|
||||
|
||||
if ( 1 == count( $sql ) ) {
|
||||
$r = $wpdb->get_col( $sql[0] );
|
||||
$ids = $wpdb->get_col( $sql[0] );
|
||||
} else {
|
||||
$r = "SELECT object_id FROM $wpdb->term_relationships WHERE 1=1";
|
||||
foreach ( $sql as $query )
|
||||
$r .= " AND object_id IN ($query)";
|
||||
|
||||
$ids = $wpdb->get_col( $r );
|
||||
}
|
||||
|
||||
if ( !empty( $ids ) )
|
||||
return " AND $object_id_column IN($r)";
|
||||
return " AND $object_id_column IN(" . implode( ', ', $ids ) . ")";
|
||||
else
|
||||
return ' AND 0 = 1';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue