Make WordPress Core

Ticket #21015: 21015.6.diff

File 21015.6.diff, 732 bytes (added by MikeHansenMe, 10 years ago)

Refreshed for 4.3

  • src/wp-admin/includes/class-wp-list-table.php

     
    521521                        return;
    522522                }
    523523
     524                $extra_checks = "AND post_status != 'auto-draft'";
     525
     526                if ( ! isset( $_GET['post_status'] ) || 'trash' != $_GET['post_status'] )
     527                        $extra_checks .= " AND post_status != 'trash'";
     528
    524529                $months = $wpdb->get_results( $wpdb->prepare( "
    525530                        SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
    526531                        FROM $wpdb->posts
    527532                        WHERE post_type = %s
     533                        " . $extra_checks . "
    528534                        ORDER BY post_date DESC
    529535                ", $post_type ) );
    530536