Use wp_count_comments() in wp.getCommentCount. Props josephscott. fixes #6941
git-svn-id: http://svn.automattic.com/wordpress/trunk@7914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3c8cb2b079
commit
94eb7224bb
|
@ -698,7 +698,13 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
|
|
||||||
do_action('xmlrpc_call', 'wp.getCommentCount');
|
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
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue