From 310940b824eff4a116dcd72ccd339bb602021981 Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 10 Jun 2008 14:08:54 +0000 Subject: Merge with branches/2.5 in WordPress, revision 8066 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1324 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/includes/dashboard.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'wp-admin/includes/dashboard.php') diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index ea88ee4..97fd26a 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -23,7 +23,9 @@ function wp_dashboard_setup() { /* Register Widgets and Controls */ // Recent Comments Widget - if ( current_user_can( 'moderate_comments' ) && $mod_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'") ) { + $mod_comments = wp_count_comments(); + $mod_comments = $mod_comments->moderated; + if ( current_user_can( 'moderate_comments' ) && $mod_comments ) { $notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments ); $notice = "$notice"; } else { -- cgit