diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 0d22441b2..d68285c98 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -973,7 +973,8 @@ function wp_edit_attachments_query( $q = false ) { } function _edit_attachments_query_helper($where) { - return $where .= ' AND post_parent < 1'; + global $wpdb; + return $where .= " AND {$wpdb->posts}.post_parent < 1"; } /**