Index: export.php
===================================================================
--- export.php	(revision 14042)
+++ export.php	(working copy)
@@ -18,7 +18,9 @@
 
 if ( isset( $_GET['download'] ) ) {
 		$author = isset($_GET['author']) ? $_GET['author'] : 'all';
-		$category = isset($_GET['category']) ? $_GET['category'] : 'all';
+		$taxonomy = array();
+		foreach ( get_taxonomies( array( 'show_ui' => true ) ) as $tax )
+			$taxonomy[ $tax ] = ! empty( $_GET['taxonomy'][ $tax ] ) ? $_GET['taxonomy'][ $tax ] : 'all';
 		$post_type = isset($_GET['post_type']) ? stripslashes_deep($_GET['post_type']) : 'all';
 		$status = isset($_GET['status']) ? stripslashes_deep($_GET['status']) : 'all';
 		$mm_start = isset($_GET['mm_start']) ? $_GET['mm_start'] : 'all';
@@ -41,16 +43,16 @@
 		} else {
 			$end_date = 'all';
 		}
-	export_wp( $author, $category, $post_type, $status, $start_date, $end_date );
+	export_wp( array( 'author' => $author, 'taxonomy' => $taxonomy, 'post_type' => $post_type, 'post_status' => $status, 'start_date' => $start_date, 'end_date' => $end_date ) );
 	die();
 }
 
 require_once ('admin-header.php');
 
 $months = "";
-for ( $i = 1; $i < 13; $i++ ) {
-	$months .= "\t\t\t<option value=\"" . zeroise($i, 2) . '">' .
-		$wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) . "</option>\n";
+for ( $i = 1; $i <= 12; $i++ ) {
+	$months .= "\t<option value=\"" . zeroise($i, 2) . '">' .
+		$wp_locale->get_month( $i ) . "</option>\n";
 } ?>
 
 <div class="wrap">
@@ -66,18 +68,17 @@
 <table class="form-table">
 <tr>
 <th><label for="mm_start"><?php _e('Restrict Date'); ?></label></th>
-<td><strong><?php _e('Start:'); ?></strong> <?php _e('Month'); ?>&nbsp;
+<td><strong><?php _e('Start:'); ?></strong> <?php _e('Month'); ?>
 <select name="mm_start" id="mm_start">
-<option value="all" selected="selected"><?php _e('All Dates'); ?></option>
+	<option value="all" selected="selected"><?php _e('All Dates'); ?></option>
 <?php echo $months; ?>
-</select>&nbsp;<?php _e('Year'); ?>&nbsp;
-<input type="text" id="aa_start" name="aa_start" value="" size="4" maxlength="5" />
-</td>
-<td><strong><?php _e('End:'); ?></strong> <?php _e('Month'); ?>&nbsp;
+</select> <?php _e('Year'); ?>
+<input type="text" id="aa_start" name="aa_start" value="" size="4" maxlength="5" /><br/>
+<strong><?php _e('End:'); ?></strong> <?php _e('Month'); ?>
 <select name="mm_end" id="mm_end">
-<option value="all" selected="selected"><?php _e('All Dates'); ?></option>
+	<option value="all" selected="selected"><?php _e('All Dates'); ?></option>
 <?php echo $months; ?>
-</select>&nbsp;<?php _e('Year'); ?>&nbsp;
+</select> <?php _e('Year'); ?>
 <input type="text" id="aa_end" name="aa_end" value="" size="4" maxlength="5" />
 </td>
 </tr>
@@ -87,38 +88,33 @@
 <select name="author" id="author">
 <option value="all" selected="selected"><?php _e('All Authors'); ?></option>
 <?php
-$authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" );
-foreach ( $authors as $id ) {
-	$o = get_userdata( $id );
-	echo "<option value='{$o->ID}'>{$o->display_name}</option>\n";
+$authors = $wpdb->get_results( "SELECT DISTINCT u.id, u.display_name FROM $wpdb->users u INNER JOIN $wpdb->posts p WHERE u.id = p.post_author ORDER BY u.display_name" );
+foreach ( (array) $authors as $author ) {
+	echo "<option value='{$author->id}'>{$author->display_name}</option>\n";
 }
 ?>
 </select>
 </td>
 </tr>
 <tr>
-<th><label for="category"><?php _e('Restrict Category'); ?></label></th>
+<th><?php _e('Restrict Taxonomies'); ?></th>
 <td>
-<select name="category" id="category">
-<option value="all" selected="selected"><?php _e('All Categories'); ?></option>
-<?php
-$categories = (array) get_categories('get=all');
-if($categories) {
-	foreach ( $categories as $cat ) {
-		echo "<option value='{$cat->term_taxonomy_id}'>{$cat->name}</option>\n";
-	}
+<?php foreach ( get_taxonomies( array( 'show_ui' => true ), 'objects' ) as $tax_obj ) {
+	$term_dropdown = wp_dropdown_categories( array( 'taxonomy' => $tax_obj->name, 'hide_if_empty' => true, 'show_option_all' => __( 'All Terms' ), 'name' => 'taxonomy[' . $tax_obj->name . ']', 'id' => 'taxonomy-' . $tax_obj->name, 'class' => '', 'echo' => false ) );
+	if ( $term_dropdown )
+		echo '<label for="taxonomy-' . $tax_obj->name . '">' . $tax_obj->label . '</label>: ' . $term_dropdown . '<br/>';
 }
 ?>
-</select>
 </td>
 </tr>
 <tr>
 <th><label for="post_type"><?php _e('Restrict Content'); ?></label></th>
 <td>
 <select name="post_type" id="post_type">
-<option value="all" selected="selected"><?php _e('All Content'); ?></option>
-<option value="page"><?php _e('Pages'); ?></option>
-<option value="post"><?php _e('Posts'); ?></option>
+	<option value="all" selected="selected"><?php _e('All Content'); ?></option>
+<?php foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $post_type_obj ) { ?>
+	<option value="<?php echo $post_type_obj->name; ?>"><?php echo $post_type_obj->label; ?></option>
+<?php } ?>
 </select>
 </td>
 </tr>
@@ -126,11 +122,10 @@
 <th><label for="status"><?php _e('Restrict Status'); ?></label></th>
 <td>
 <select name="status" id="status">
-<option value="all" selected="selected"><?php _e('All Statuses'); ?></option>
-<option value="draft"><?php _e('Draft'); ?></option>
-<option value="private"><?php _e('Privately published'); ?></option>
-<option value="publish"><?php _e('Published'); ?></option>
-<option value="future"><?php _e('Scheduled'); ?></option>
+	<option value="all" selected="selected"><?php _e('All Statuses'); ?></option>
+<?php foreach ( get_post_stati( array( 'internal' => false ), 'objects' ) as $post_status_obj ) { ?>
+	<option value="<?php echo $post_status_obj->name; ?>"><?php echo $post_status_obj->label; ?></option>
+<?php } ?>
 </select>
 </td>
 </tr>
Index: includes/export.php
===================================================================
--- includes/export.php	(revision 14042)
+++ includes/export.php	(working copy)
@@ -21,11 +21,16 @@
  *
  * @since unknown
  *
- * @param unknown_type $author
+ * @param unknown_type $args
  */
-function export_wp($author='', $category='', $post_type='', $status='', $start_date='', $end_date='') {
+function export_wp( $args = array() ) {
 global $wpdb, $post_ids, $post, $wp_taxonomies;
 
+if ( ! is_array( $args ) )
+	$args = array( 'author' => $args );
+$defaults = array( 'author' => null, 'taxonomy' => null, 'post_type' => null, 'post_status' => null, 'start_date' => null, 'end_date' => null );
+$args = wp_parse_args( $args, $defaults );
+
 do_action('export_wp');
 
 if(strlen($start_date) > 4 && strlen($end_date) > 4) {
@@ -38,27 +43,29 @@
 header("Content-Disposition: attachment; filename=$filename");
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
 
-if ( $post_type and $post_type != 'all' ) {
+if ( $post_type && $post_type != 'all' ) {
 		$where = $wpdb->prepare("WHERE post_type = %s ", $post_type);
 } else {
 		$where = "WHERE post_type != 'revision' ";
 }
-if ( $author and $author != 'all' ) {
+if ( $author && $author != 'all' ) {
 		$author_id = (int) $author;
 		$where .= $wpdb->prepare("AND post_author = %d ", $author_id);
 }
-if ( $start_date and $start_date != 'all' ) {
+if ( $start_date && $start_date != 'all' ) {
 		$where .= $wpdb->prepare("AND post_date >= %s ", $start_date);
 }
-if ( $end_date and $end_date != 'all' ) {
+if ( $end_date && $end_date != 'all' ) {
 		$where .= $wpdb->prepare("AND post_date < %s ", $end_date);
 }
-if ( $category and $category != 'all' ) {
-		$taxomony_id = (int) $category;
-		$where .= $wpdb->prepare("AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} " . "WHERE term_taxonomy_id = %d) ", $taxomony_id);
+if ( $taxonomy && is_array( $taxonomy ) ) {
+	foreach ( $taxonomy as $term_id ) {
+		if ( $tax != 'all' )
+			$where .= $wpdb->prepare("AND ID IN (SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d) ", $term_id);
+	}
 }
-if ( $status and $status != 'all' ) {
-		$where .= $wpdb->prepare("AND post_status = %s ", $status);
+if ( $status && $status != 'all' ) {
+		$where .= $wpdb->prepare("AND post_status = %s", $status);
 }
 
 // grab a snapshot of post IDs, just in case it changes during the export
