Add post_password to export. Props Nazgul. fixes #4376

git-svn-id: http://svn.automattic.com/wordpress/trunk@6753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-02-07 19:22:59 +00:00
parent 7646d94d88
commit 47faf261ba
2 changed files with 4 additions and 2 deletions

View File

@ -350,6 +350,7 @@ class WP_Import {
$post_parent = $this->get_tag( $post, 'wp:post_parent' ); $post_parent = $this->get_tag( $post, 'wp:post_parent' );
$menu_order = $this->get_tag( $post, 'wp:menu_order' ); $menu_order = $this->get_tag( $post, 'wp:menu_order' );
$post_type = $this->get_tag( $post, 'wp:post_type' ); $post_type = $this->get_tag( $post, 'wp:post_type' );
$post_password = $this->get_tag( $post, 'wp:post_password' );
$guid = $this->get_tag( $post, 'guid' ); $guid = $this->get_tag( $post, 'guid' );
$post_author = $this->get_tag( $post, 'dc:creator' ); $post_author = $this->get_tag( $post, 'dc:creator' );
@ -400,7 +401,7 @@ class WP_Import {
$post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor $post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type'); $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password');
if ($post_type == 'attachment') { if ($post_type == 'attachment') {
$remote_url = $this->get_tag( $post, 'wp:attachment_url' ); $remote_url = $this->get_tag( $post, 'wp:attachment_url' );
if ( !$remote_url ) if ( !$remote_url )

View File

@ -192,7 +192,7 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
foreach ($posts as $post) { foreach ($posts as $post) {
setup_postdata($post); ?> setup_postdata($post); ?>
<item> <item>
<title><?php the_title_rss() ?></title> <title><?php echo apply_filters('the_title_rss', $post->post_title); ?></title>
<link><?php the_permalink_rss() ?></link> <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> <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> <dc:creator><?php the_author() ?></dc:creator>
@ -211,6 +211,7 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
<wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent> <wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent>
<wp:menu_order><?php echo $post->menu_order; ?></wp:menu_order> <wp:menu_order><?php echo $post->menu_order; ?></wp:menu_order>
<wp:post_type><?php echo $post->post_type; ?></wp:post_type> <wp:post_type><?php echo $post->post_type; ?></wp:post_type>
<wp:post_password><?php echo $post->post_password; ?></wp:post_password>
<?php <?php
if ($post->post_type == 'attachment') { ?> if ($post->post_type == 'attachment') { ?>
<wp:attachment_url><?php echo wp_get_attachment_url($post->ID); ?></wp:attachment_url> <wp:attachment_url><?php echo wp_get_attachment_url($post->ID); ?></wp:attachment_url>