-?>
-<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
-<!-- It contains information about your blog's posts, comments, and categories. -->
-<!-- You may use this file to transfer that content from one site to another. -->
-<!-- This file is not intended to serve as a complete backup of your blog. -->
-
-<!-- To import this information into a WordPress blog follow these steps. -->
-<!-- 1. Log into that blog as an administrator. -->
-<!-- 2. Go to Manage: Import in the blog's admin panels. -->
-<!-- 3. Choose "WordPress" from the list. -->
-<!-- 4. Upload this file using the form provided on that page. -->
-<!-- 5. You will first be asked to map the authors in this export file to users -->
-<!-- on the blog. For each author, you may choose to map to an -->
-<!-- existing user on the blog or to create a new user -->
-<!-- 6. WordPress will then import each of the posts, comments, and categories -->
-<!-- contained in this file into your blog -->
-
-<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:i'); ?>"-->
-<rss version="2.0"
- xmlns:content="http://purl.org/rss/1.0/modules/content/"
- xmlns:wfw="http://wellformedweb.org/CommentAPI/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:wp="http://wordpress.org/export/1.0/"
->
-
-<channel>
- <title><?php bloginfo_rss('name'); ?></title>
- <link><?php bloginfo_rss('url') ?></link>
- <description><?php bloginfo_rss("description") ?></description>
- <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
- <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
- <language><?php echo get_option('rss_language'); ?></language>
-<?php if ( $cats ) : foreach ( $cats as $c ) : ?>
- <wp:category><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->name : ''; ?></wp:category_parent><?php wxr_cat_name($c); ?><?php wxr_category_description($c); ?></wp:category>
-<?php endforeach; endif; ?>
-<?php if ( $tags ) : foreach ( $tags as $t ) : ?>
- <wp:tag><wp:tag_slug><?php echo $t->slug; ?></wp:tag_slug><?php wxr_tag_name($t); ?><?php wxr_tag_description($t); ?></wp:tag>
-<?php endforeach; endif; ?>
- <?php do_action('rss2_head'); ?>
- <?php if ($post_ids) {
- global $wp_query;
- $wp_query->in_the_loop = true; // Fake being in the loop.
- // fetch 20 posts at a time rather than loading the entire table into memory
- while ( $next_posts = array_splice($post_ids, 0, 20) ) {
- $where = "WHERE ID IN (".join(',', $next_posts).")";
- $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
- foreach ($posts as $post) {
- setup_postdata($post); ?>
-<item>
-<title><?php the_title_rss() ?></title>
-<link><?php the_permalink_rss() ?></link>
-<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
-<dc:creator><?php the_author() ?></dc:creator>
-<?php wxr_post_taxonomy() ?>
-
-<guid isPermaLink="false"><?php the_guid(); ?></guid>
-<description></description>
-<content:encoded><![CDATA[<?php echo $post->post_content ?>]]></content:encoded>
-<wp:post_id><?php echo $post->ID; ?></wp:post_id>
-<wp:post_date><?php echo $post->post_date; ?></wp:post_date>
-<wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt>
-<wp:comment_status><?php echo $post->comment_status; ?></wp:comment_status>
-<wp:ping_status><?php echo $post->ping_status; ?></wp:ping_status>
-<wp:post_name><?php echo $post->post_name; ?></wp:post_name>
-<wp:status><?php echo $post->post_status; ?></wp:status>
-<wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent>
-<wp:menu_order><?php echo $post->menu_order; ?></wp:menu_order>
-<wp:post_type><?php echo $post->post_type; ?></wp:post_type>
+<h2><?php _e( 'Choose what to export' ); ?></h2>
+<form method="get" id="export-filters">
+<fieldset>
+<legend class="screen-reader-text"><?php _e( 'Content to export' ); ?></legend>
+<input type="hidden" name="download" value="true" />
+<p><label><input type="radio" name="content" value="all" checked="checked" aria-describedby="all-content-desc" /> <?php _e( 'All content' ); ?></label></p>
+<p class="description" id="all-content-desc"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus, and custom posts.' ); ?></p>
+
+<p><label><input type="radio" name="content" value="posts" /> <?php _e( 'Posts' ); ?></label></p>
+<ul id="post-filters" class="export-filters">
+ <li>
+ <label><span class="label-responsive"><?php _e( 'Categories:' ); ?></span>
+ <?php wp_dropdown_categories( array( 'show_option_all' => __('All') ) ); ?>
+ </label>
+ </li>
+ <li>
+ <label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span>
+ <?php
+ $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" );
+ wp_dropdown_users( array(
+ 'include' => $authors,
+ 'name' => 'post_author',
+ 'multi' => true,
+ 'show_option_all' => __( 'All' ),
+ 'show' => 'display_name_with_login',
+ ) ); ?>
+ </label>
+ </li>
+ <li>
+ <fieldset>
+ <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
+ <label for="post-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
+ <select name="post_start_date" id="post-start-date">
+ <option value="0"><?php _e( '— Select —' ); ?></option>
+ <?php export_date_options(); ?>
+ </select>
+ <label for="post-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
+ <select name="post_end_date" id="post-end-date">
+ <option value="0"><?php _e( '— Select —' ); ?></option>
+ <?php export_date_options(); ?>
+ </select>
+ </fieldset>
+ </li>
+ <li>
+ <label for="post-status" class="label-responsive"><?php _e( 'Status:' ); ?></label>
+ <select name="post_status" id="post-status">
+ <option value="0"><?php _e( 'All' ); ?></option>
+ <?php $post_stati = get_post_stati( array( 'internal' => false ), 'objects' );
+ foreach ( $post_stati as $status ) : ?>
+ <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+</ul>
+
+<p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p>
+<ul id="page-filters" class="export-filters">
+ <li>
+ <label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span>
+ <?php
+ $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" );
+ wp_dropdown_users( array(
+ 'include' => $authors,
+ 'name' => 'page_author',
+ 'multi' => true,
+ 'show_option_all' => __( 'All' ),
+ 'show' => 'display_name_with_login',
+ ) ); ?>
+ </label>
+ </li>
+ <li>
+ <fieldset>
+ <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
+ <label for="page-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
+ <select name="page_start_date" id="page-start-date">
+ <option value="0"><?php _e( '— Select —' ); ?></option>
+ <?php export_date_options( 'page' ); ?>
+ </select>
+ <label for="page-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
+ <select name="page_end_date" id="page-end-date">
+ <option value="0"><?php _e( '— Select —' ); ?></option>
+ <?php export_date_options( 'page' ); ?>
+ </select>
+ </fieldset>
+ </li>
+ <li>
+ <label for="page-status" class="label-responsive"><?php _e( 'Status:' ); ?></label>
+ <select name="page_status" id="page-status">
+ <option value="0"><?php _e( 'All' ); ?></option>
+ <?php foreach ( $post_stati as $status ) : ?>
+ <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+</ul>
+
+<?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?>
+<p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p>
+<?php endforeach; ?>
+
+<p><label><input type="radio" name="content" value="attachment" /> <?php _e( 'Media' ); ?></label></p>
+<ul id="attachment-filters" class="export-filters">
+ <li>
+ <fieldset>
+ <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
+ <label for="attachment-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
+ <select name="attachment_start_date" id="attachment-start-date">
+ <option value="0"><?php _e( '— Select —' ); ?></option>
+ <?php export_date_options( 'attachment' ); ?>
+ </select>
+ <label for="attachment-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
+ <select name="attachment_end_date" id="attachment-end-date">
+ <option value="0"><?php _e( '— Select —' ); ?></option>
+ <?php export_date_options( 'attachment' ); ?>
+ </select>
+ </fieldset>
+ </li>
+</ul>
+
+</fieldset>