Always pass a table alias to wp_post_mime_type_where(). Prevents ambiguous queries when adding joins later on. props benbalter, fixes #20193.

git-svn-id: https://develop.svn.wordpress.org/trunk@20325 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-03-30 13:08:12 +00:00
parent a5585e4b61
commit 0fe62673e5
1 changed files with 2 additions and 4 deletions

View File

@ -2311,10 +2311,8 @@ class WP_Query {
// MIME-Type stuff for attachment browsing
if ( isset($q['post_mime_type']) && '' != $q['post_mime_type'] ) {
$table_alias = $post_status_join ? $wpdb->posts : '';
$whichmimetype = wp_post_mime_type_where($q['post_mime_type'], $table_alias);
}
if ( isset( $q['post_mime_type'] ) && '' != $q['post_mime_type'] )
$whichmimetype = wp_post_mime_type_where( $q['post_mime_type'], $wpdb->posts );
$where .= $search . $whichauthor . $whichmimetype;