Make WordPress Core

Ticket #21015: 21015.5.patch

File 21015.5.patch, 775 bytes (added by CoenJacobs, 13 years ago)

Revised patch, tested against current trunk

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

     
    360360        function months_dropdown( $post_type ) {
    361361                global $wpdb, $wp_locale;
    362362
     363                $extra_checks = "AND post_status != 'auto-draft'";
     364
     365                if ( ! isset( $_GET['post_status'] ) || 'trash' != $_GET['post_status'] )
     366                        $extra_checks .= " AND post_status != 'trash'";
     367
    363368                $months = $wpdb->get_results( $wpdb->prepare( "
    364369                        SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
    365370                        FROM $wpdb->posts
    366371                        WHERE post_type = %s
     372                        " . $extra_checks . "
    367373                        ORDER BY post_date DESC
    368374                ", $post_type ) );
    369375