WordPress.org

Make WordPress Core

Changeset 15652


Ignore:
Timestamp:
09/24/10 12:09:44 (7 years ago)
Author:
dd32
Message:

Do not generate invalid SQL for empty term archives. See #12891

File:
1 edited

Legend:

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

    r15650 r15652  
    19221922            } 
    19231923 
    1924             $where .= " AND $wpdb->posts.ID IN( " . implode( ', ', wp_tax_query( $tax_query ) ) . ")"; 
     1924            $ids = wp_tax_query( $tax_query ); 
     1925            if ( !empty($ids) ) 
     1926                $where .= " AND $wpdb->posts.ID IN(" . implode( ', ', $ids ) . ")"; 
     1927            else 
     1928                $where .= ' AND 0 = 1'; 
    19251929        } 
    19261930 
Note: See TracChangeset for help on using the changeset viewer.