WordPress.org

Make WordPress Core

Ticket #14222: 14222.3.patch

File 14222.3.patch, 1023 bytes (added by SergeyBiryukov, 9 years ago)
  • wp-admin/includes/dashboard.php

     
    624624        $total_items = isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] )
    625625                ? absint( $widgets['dashboard_recent_comments']['items'] ) : 5;
    626626
    627         while ( count( $comments ) < $total_items && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) {
     627        while ( count( $comments ) < $total_items && $possible = $wpdb->get_results( "SELECT c.* FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) {
    628628
    629629                foreach ( $possible as $comment ) {
    630630                        if ( count( $comments ) >= $total_items )