From 2d9f6514c12e136a5c223e4e743259f9ceeed9e8 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sat, 27 Sep 2008 21:26:57 +0000 Subject: [PATCH] Add a filter to get_usernumposts. Fixes #7786 props Malaiac. git-svn-id: https://develop.svn.wordpress.org/trunk@9009 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 e7fe5f775b..29d08ce28c 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); } /**