diff --git a/wp-admin/export.php b/wp-admin/export.php
index 8d3a47f6aa..7fe1e554a0 100644
--- a/wp-admin/export.php
+++ b/wp-admin/export.php
@@ -45,7 +45,7 @@ foreach ( $authors as $id ) {
get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
+// grab a snapshot of post IDs, just in case it changes during the export
+$post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
$categories = (array) get_categories('get=all');
@@ -166,7 +167,13 @@ print '\n";
slug; ?>parent ? $cats[$c->parent]->name : ''; ?>
-
+ get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
+ foreach ($posts as $post) {
+ start_wp(); ?>
@@ -216,7 +223,7 @@ if ( $comments ) { foreach ( $comments as $c ) { ?>
-
+