From a1f451b72a8cbd366548c5d912aa5810fcd8c96f Mon Sep 17 00:00:00 2001 From: rob1n Date: Tue, 19 Jun 2007 17:57:53 +0000 Subject: [PATCH] Fix up wp_list_authors() SQL. fixes #4485 git-svn-id: https://develop.svn.wordpress.org/trunk@5727 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/author-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/author-template.php b/wp-includes/author-template.php index 699319cc39..8ec3786634 100644 --- a/wp-includes/author-template.php +++ b/wp-includes/author-template.php @@ -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; }