From d6fb70098fdb8c7bec7df823d8187f7e7f0a8624 Mon Sep 17 00:00:00 2001 From: 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: http://svn.automattic.com/wordpress/trunk@19720 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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"; } /**