Use proper prefix in query. Fixes user queries ordered by post count. Props ziofix, ericmann. fixes #17123 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@17634 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ac0c1a2a77
commit
cf2f1ad547
@ -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
Block a user