WordPress.org

Make WordPress Core

Ticket #17022: months_dropdown_3.2.patch

File months_dropdown_3.2.patch, 745 bytes (added by kevinB, 7 years ago)

query filter for months_dropdown()

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

     
    345345        function months_dropdown( $post_type ) {
    346346                global $wpdb, $wp_locale;
    347347
    348                 $months = $wpdb->get_results( $wpdb->prepare( "
     348                $months = $wpdb->get_results( apply_filters( 'months_dropdown_query', $wpdb->prepare( "
    349349                        SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
    350350                        FROM $wpdb->posts
    351351                        WHERE post_type = %s
    352352                        ORDER BY post_date DESC
    353                 ", $post_type ) );
     353                ", $post_type ), $post_type ) );
    354354
    355355                $month_count = count( $months );
    356356