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
This commit is contained in:
Andrew Nacin 2012-08-20 16:49:21 +00:00
parent 8cac9d023a
commit 56dd6e86a3
1 changed files with 8 additions and 1 deletions

View File

@ -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( "