mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 15:47:38 +02:00
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: http://svn.automattic.com/wordpress/trunk@20325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
07c5c0784e
commit
c0a461e6fe
@ -2311,10 +2311,8 @@ class WP_Query {
|
|||||||
|
|
||||||
// MIME-Type stuff for attachment browsing
|
// MIME-Type stuff for attachment browsing
|
||||||
|
|
||||||
if ( isset($q['post_mime_type']) && '' != $q['post_mime_type'] ) {
|
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'], $wpdb->posts );
|
||||||
$whichmimetype = wp_post_mime_type_where($q['post_mime_type'], $table_alias);
|
|
||||||
}
|
|
||||||
|
|
||||||
$where .= $search . $whichauthor . $whichmimetype;
|
$where .= $search . $whichauthor . $whichmimetype;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user