WordPress.org

Make WordPress Core

Ticket #13869: better-admin-comment-type-support.diff

File better-admin-comment-type-support.diff, 1.4 KB (added by jdub, 5 years ago)
  • wp-admin/edit-comments.php

     
    125125if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'trash')) ) 
    126126        $comment_status = 'all'; 
    127127 
    128 $comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : ''; 
     128$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : 'comment'; 
    129129 
    130130$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : ''; 
    131131$search = esc_attr( $search_dirty ); ?> 
  • wp-admin/includes/dashboard.php

     
    537537        else 
    538538                $total_items = 5; 
    539539 
    540         while ( count( $comments ) < 5 && $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" ) ) { 
     540        while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE c.comment_type = '' AND p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) { 
    541541 
    542542                foreach ( $possible as $comment ) { 
    543543                        if ( count( $comments ) >= $total_items )