WordPress.org

Make WordPress Core

Ticket #27802: 27802.diff

File 27802.diff, 586 bytes (added by jeremyfelt, 6 years ago)
  • src/wp-includes/post.php

     
    22762276
    22772277        $counts = array();
    22782278        foreach( (array) $count as $row ) {
    2279                 $counts[ $row['post_mime_type'] ] = $row['num_posts'];
     2279                if ( ! empty( $row['post_mime_type'] ) ) {
     2280                        $counts[ $row['post_mime_type'] ] = $row['num_posts'];
     2281                }
    22802282        }
    22812283        $counts['trash'] = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status = 'trash' $and");
    22822284