diff --git a/wp-admin/includes/class-wp-users-list-table.php b/wp-admin/includes/class-wp-users-list-table.php index f264fa243e..68ced7c785 100644 --- a/wp-admin/includes/class-wp-users-list-table.php +++ b/wp-admin/includes/class-wp-users-list-table.php @@ -169,7 +169,6 @@ class WP_Users_List_Table extends WP_List_Table { 'username' => 'login', 'name' => 'name', 'email' => 'email', - 'posts' => 'post_count', ); if ( $this->is_site_users ) diff --git a/wp-includes/user.php b/wp-includes/user.php index 042fc9151c..d08c95713b 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -431,6 +431,7 @@ class WP_User_Query { } elseif ( 'name' == $qv['orderby'] || 'display_name' == $qv['orderby'] ) { $orderby = 'display_name'; } elseif ( 'post_count' == $qv['orderby'] ) { + // todo: avoid the JOIN $where = get_posts_by_author_sql('post'); $this->query_from .= " LEFT OUTER JOIN ( SELECT post_author, COUNT(*) as post_count