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
This commit is contained in:
parent
1e96186c14
commit
ae9e348cd6
|
@ -438,7 +438,7 @@ class WP_User_Query {
|
||||||
$where = get_posts_by_author_sql('post');
|
$where = get_posts_by_author_sql('post');
|
||||||
$this->query_from .= " LEFT OUTER JOIN (
|
$this->query_from .= " LEFT OUTER JOIN (
|
||||||
SELECT post_author, COUNT(*) as post_count
|
SELECT post_author, COUNT(*) as post_count
|
||||||
FROM wp_posts
|
FROM $wpdb->posts
|
||||||
$where
|
$where
|
||||||
GROUP BY post_author
|
GROUP BY post_author
|
||||||
) p ON ({$wpdb->users}.ID = p.post_author)
|
) p ON ({$wpdb->users}.ID = p.post_author)
|
||||||
|
|
Loading…
Reference in New Issue