From 4a16bf61be6018d02c325818447133499401ecfc Mon Sep 17 00:00:00 2001 From: rob1n Date: Fri, 6 Apr 2007 03:29:44 +0000 Subject: [PATCH] Add private posts to get_usernumposts() when the current_user_can read_private_posts. Props molecularbear. fixes #3868 git-svn-id: https://develop.svn.wordpress.org/trunk@5190 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 8b8151498e..44c70092c9 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -10,7 +10,7 @@ function get_profile($field, $user = false) { function get_usernumposts($userid) { global $wpdb; $userid = (int) $userid; - return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$userid' AND post_type = 'post' AND post_status = 'publish'"); + return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$userid' AND post_type = 'post' " . get_private_posts_cap_sql()); } // TODO: xmlrpc only. Maybe move to xmlrpc.php.