mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Use wp_count_comments() instead of direct query.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
88b23960fb
commit
f97c96fde0
@ -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_commens = $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 = "<a href='edit-comments.php?comment_status=moderated'>$notice</a>";
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user