From ba219cf998a37778ba5e1da6ae4f637ce4568b41 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 9 Jan 2012 15:55:30 +0000 Subject: [PATCH] Prefix table name against the post_parent field in _edit_attachments_query_helper() to avoid ambiguous queries. props benbalter. fixes #19779. git-svn-id: https://develop.svn.wordpress.org/trunk@19720 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 0d22441b25..d68285c981 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"; } /**