Fake being in the loop during export so that template tags work.

git-svn-id: https://develop.svn.wordpress.org/trunk@6130 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-09-18 18:01:47 +00:00
parent b0baf1b7fd
commit 7aabf7336f
1 changed files with 2 additions and 0 deletions

View File

@ -188,6 +188,8 @@ print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
<?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).")";