diff --git a/wp-admin/export.php b/wp-admin/export.php index 1519961ba9..839ceefcce 100644 --- a/wp-admin/export.php +++ b/wp-admin/export.php @@ -95,15 +95,15 @@ if ( isset( $_GET['download'] ) ) { require_once ('admin-header.php'); -function export_date_options() { +function export_date_options( $post_type = 'post' ) { global $wpdb, $wp_locale; - $months = $wpdb->get_results( " + $months = $wpdb->get_results( $wpdb->prepare( " SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month FROM $wpdb->posts - WHERE post_type = 'post' AND post_status != 'auto-draft' + WHERE post_type = %s AND post_status != 'auto-draft' ORDER BY post_date DESC - " ); + ", $post_type ) ); $month_count = count( $months ); if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) @@ -182,11 +182,11 @@ function export_date_options() {