From 4ba5f806d79b50480065a830b112fc4139798d6c Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 6 Jul 2007 20:57:28 +0000 Subject: [PATCH] Reduce export mem usage. Props tellyworth. fixes #4589 git-svn-id: http://svn.automattic.com/wordpress/trunk@5785 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/export.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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(); ?> <?php the_title_rss() ?> @@ -216,7 +223,7 @@ if ( $comments ) { foreach ( $comments as $c ) { ?> - +