Ticket #17022: 17022.2.diff
File 17022.2.diff, 1.0 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/class-wp-list-table.php
360 360 function months_dropdown( $post_type ) { 361 361 global $wpdb, $wp_locale; 362 362 363 $ months = $wpdb->get_results($wpdb->prepare( "363 $sql = $wpdb->prepare( " 364 364 SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month 365 365 FROM $wpdb->posts 366 366 WHERE post_type = %s 367 367 ORDER BY post_date DESC 368 ", $post_type ) );368 ", $post_type ); 369 369 370 /** 371 * Filter the months dropdown SQL query. 372 * 373 * @since 3.7.0 374 * 375 * @param string $sql The months dropdown SQL query. 376 * @param string $post_type The post type. 377 */ 378 $months = $wpdb->get_results( apply_filters( 'months_dropdown_query', $sql, $post_type ) ); 370 379 $month_count = count( $months ); 371 380 372 381 if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )