Fix up wp_list_authors() SQL. fixes #4485
git-svn-id: https://develop.svn.wordpress.org/trunk@5727 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7df77b79b9
commit
a1f451b72a
@ -378,7 +378,7 @@ function wp_list_authors($args = '') {
|
||||
$authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name");
|
||||
|
||||
$author_count = array();
|
||||
foreach ((array) $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_status = 'publish' GROUP BY post_author") as $row) {
|
||||
foreach ((array) $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author") as $row) {
|
||||
$author_count[$row->post_author] = $row->count;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user