From ae9e348cd6b5ed544021ef9000accfb376a9f526 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 13 Apr 2011 17:02:08 +0000 Subject: [PATCH] Use proper prefix in query. Fixes user queries ordered by post count. Props ziofix, ericmann. fixes #17123 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@17634 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index cd4b01d9c..0a1a4354a 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -438,7 +438,7 @@ class WP_User_Query { $where = get_posts_by_author_sql('post'); $this->query_from .= " LEFT OUTER JOIN ( SELECT post_author, COUNT(*) as post_count - FROM wp_posts + FROM $wpdb->posts $where GROUP BY post_author ) p ON ({$wpdb->users}.ID = p.post_author)