From 56dd6e86a3a1a9e948c8c6fdc3872b11c1554bf5 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 20 Aug 2012 16:49:21 +0000 Subject: [PATCH] Add term_taxonomy_id field handling to WP_Tax_Query::transform_query(), allowing the transformation to be bypassed when tt ids are passed. props wonderboymusic. fixes #21228. git-svn-id: https://develop.svn.wordpress.org/trunk@21552 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/taxonomy.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 61573dd00b..b34fb3f169 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -790,7 +790,14 @@ class WP_Tax_Query { AND $wpdb->terms.{$query['field']} IN ($terms) " ); break; - + case 'term_taxonomy_id': + $terms = implode( ',', array_map( 'intval', $query['terms'] ) ); + $terms = $wpdb->get_col( " + SELECT $resulting_field + FROM $wpdb->term_taxonomy + WHERE term_taxonomy_id IN ($terms) + " ); + break; default: $terms = implode( ',', array_map( 'intval', $query['terms'] ) ); $terms = $wpdb->get_col( "