WordPress.org

Make WordPress Core

Ticket #19312: 19312.diff

File 19312.diff, 1.2 KB (added by sorich87, 7 years ago)
  • wp-admin/export.php

     
    9393
    9494require_once ('admin-header.php');
    9595
    96 function export_date_options() {
     96function export_date_options( $post_type = 'post' ) {
    9797        global $wpdb, $wp_locale;
    9898
    99         $months = $wpdb->get_results( "
     99        $months = $wpdb->get_results( $wpdb->prepare( "
    100100                SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
    101101                FROM $wpdb->posts
    102                 WHERE post_type = 'post' AND post_status != 'auto-draft'
     102                WHERE post_type = %s AND post_status != 'auto-draft'
    103103                ORDER BY post_date DESC
    104         " );
     104        ", $post_type ) );
    105105
    106106        $month_count = count( $months );
    107107        if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
     
    180180                <label><?php _e( 'Date range:' ); ?></label>
    181181                <select name="page_start_date">
    182182                        <option value="0"><?php _e( 'Start Date' ); ?></option>
    183                         <?php export_date_options(); ?>
     183                        <?php export_date_options( 'page' ); ?>
    184184                </select>
    185185                <select name="page_end_date">
    186186                        <option value="0"><?php _e( 'End Date' ); ?></option>
    187                         <?php export_date_options(); ?>
     187                        <?php export_date_options( 'page' ); ?>
    188188                </select>
    189189        </li>
    190190        <li>