Ticket #21015: 21015.4.patch
File 21015.4.patch, 846 bytes (added by , 13 years ago) |
---|
-
wp-admin/includes/class-wp-list-table.php
362 362 */ 363 363 function months_dropdown( $post_type ) { 364 364 global $wpdb, $wp_locale; 365 366 $extra_checks = "AND post_status != 'auto-draft'"; 365 367 368 if ( ! isset( $_GET['post_status'] ) || ( isset( $_GET['post_status'] ) && 'trash' != $_GET['post_status'] ) ) 369 $extra_checks .= " AND post_status != 'trash'"; 370 366 371 $months = $wpdb->get_results( $wpdb->prepare( " 367 372 SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month 368 373 FROM $wpdb->posts 369 WHERE post_type = %s 374 WHERE post_type = %s 375 " . $extra_checks . " 370 376 ORDER BY post_date DESC 371 377 ", $post_type ) ); 372 378