WordPress.org

Make WordPress Core

Changeset 7851


Ignore:
Timestamp:
04/29/08 18:30:45 (6 years ago)
Author:
ryan
Message:

Use wp_count_comments() instead of direct query.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r7730 r7851  
    2424 
    2525    // Recent Comments Widget 
    26     if ( current_user_can( 'moderate_comments' ) && $mod_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'") ) { 
     26    $mod_comments = wp_count_comments(); 
     27    $mod_commens = $mod_comments->moderated; 
     28    if ( current_user_can( 'moderate_comments' ) && $mod_comments ) { 
    2729        $notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments ); 
    2830        $notice = "<a href='edit-comments.php?comment_status=moderated'>$notice</a>"; 
Note: See TracChangeset for help on using the changeset viewer.