Make WordPress Core

Ticket #21015: 21015.3.patch

File 21015.3.patch, 745 bytes (added by MikeHansenMe, 13 years ago)
  • wp-admin/includes/class-wp-list-table.php

     
    362362         */
    363363        function months_dropdown( $post_type ) {
    364364                global $wpdb, $wp_locale;
    365 
     365                $extra_checks = "";
     366                if($_GET['post_status'] != "trash"){
     367                $extra_checks = "AND post_status != 'trash'";
     368                }       
    366369                $months = $wpdb->get_results( $wpdb->prepare( "
    367370                        SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
    368371                        FROM $wpdb->posts
    369372                        WHERE post_type = %s
     373                        AND post_status != 'auto-draft'
     374                        ".$extra_checks."
    370375                        ORDER BY post_date DESC
    371376                ", $post_type ) );
    372377