From 0eb86404da7bf28a57934b63cf650a644c2b9dd4 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: http://svn.automattic.com/wordpress/trunk@5727 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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; }