From 4f11ea671aa3eb9672f33e4f3791fc01a0b5fd0d Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 9 May 2008 16:02:44 +0000 Subject: [PATCH] Use wp_count_comments() in wp.getCommentCount. Props josephscott. fixes #6941 git-svn-id: https://develop.svn.wordpress.org/trunk@7914 602fd350-edb4-49c9-b593-d223f7449a82 --- xmlrpc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xmlrpc.php b/xmlrpc.php index 7a0fb48f91..daaf3ab2f7 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -698,7 +698,13 @@ class wp_xmlrpc_server extends IXR_Server { do_action('xmlrpc_call', 'wp.getCommentCount'); - return get_comment_count( $post_id ); + $count = wp_count_comments( $post_id ); + return array( + "approved" => $count->approved, + "awaiting_moderation" => $count->moderated, + "spam" => $count->spam, + "total_comments" => $count->total_comments + ); }