WordPress.org

Make WordPress Core

Changeset 21552


Ignore:
Timestamp:
08/20/2012 04:49:21 PM (7 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r21501 r21552  
    791791                " );
    792792                break;
    793 
     793            case 'term_taxonomy_id':
     794                $terms = implode( ',', array_map( 'intval', $query['terms'] ) );
     795                $terms = $wpdb->get_col( "
     796                    SELECT $resulting_field
     797                    FROM $wpdb->term_taxonomy
     798                    WHERE term_taxonomy_id IN ($terms)
     799                " );
     800                break;
    794801            default:
    795802                $terms = implode( ',', array_map( 'intval', $query['terms'] ) );
Note: See TracChangeset for help on using the changeset viewer.