From 99b9a27052d5f56d85bf08f61e463bee252a2478 Mon Sep 17 00:00:00 2001 From: westi Date: Sat, 27 Sep 2008 21:26:57 +0000 Subject: [PATCH] Add a filter to get_usernumposts. Fixes #7786 props Malaiac. git-svn-id: http://svn.automattic.com/wordpress/trunk@9009 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index e7fe5f775..29d08ce28 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -123,7 +123,8 @@ function get_profile($field, $user = false) { function get_usernumposts($userid) { global $wpdb; $userid = (int) $userid; - return $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND ", $userid) . get_private_posts_cap_sql('post')); + $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND ", $userid) . get_private_posts_cap_sql('post')); + return apply_filters('get_usernumposts', $count, $userid); } /**