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: http://core.svn.wordpress.org/trunk@21552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-08-20 16:49:21 +00:00
parent bfaaa3d8ab
commit 9eeccc2230
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) AND $wpdb->terms.{$query['field']} IN ($terms)
" ); " );
break; 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: default:
$terms = implode( ',', array_map( 'intval', $query['terms'] ) ); $terms = implode( ',', array_map( 'intval', $query['terms'] ) );
$terms = $wpdb->get_col( " $terms = $wpdb->get_col( "