From af6dbfde54f09ba631896d430e536f1fdc54898b Mon Sep 17 00:00:00 2001 From: scribu Date: Tue, 16 Nov 2010 16:24:14 +0000 Subject: [PATCH] Revert taxonomy.php part of [16402]. Not fully backed yet. See #12891 git-svn-id: http://svn.automattic.com/wordpress/trunk@16403 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 3cfc91efde..bef3522e14 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -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'; }