Make WordPress Core

Ticket #4376: 4376.diff

File 4376.diff, 2.9 KB (added by Nazgul, 17 years ago)
  • wp-admin/export.php

     
    193193                        $where = "WHERE ID IN (".join(',', $next_posts).")";
    194194                        $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
    195195                                foreach ($posts as $post) {
    196                         setup_postdata($post); ?>
     196                                        setup_postdata($post);
     197                                       
     198                                        // Strip Protected or Private prefixes from the title.
     199                                        $post_title = get_the_title_rss();
     200                                        if ( !empty($post->post_password) )
     201                                                $post_title = str_replace( sprintf(__('Protected: %s'), ''), '', $post_title);
     202                                        else if ( 'private' == $post->post_status )
     203                                                $post_title = str_replace( sprintf(__('Private: %s'), ''), '', $post_title);
     204                                        ?>
    197205<item>
    198 <title><?php the_title_rss() ?></title>
     206<title><?php echo $post_title; ?></title>
    199207<link><?php the_permalink_rss() ?></link>
    200208<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
    201209<dc:creator><?php the_author() ?></dc:creator>
     
    214222<wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent>
    215223<wp:menu_order><?php echo $post->menu_order; ?></wp:menu_order>
    216224<wp:post_type><?php echo $post->post_type; ?></wp:post_type>
     225<wp:post_password><?php echo $post->post_password; ?></wp:post_password>
    217226<?php
    218227$postmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID");
    219228if ( $postmeta ) {
  • wp-admin/import/wordpress.php

     
    278278                $post_parent    = $this->get_tag( $post, 'wp:post_parent' );
    279279                $menu_order     = $this->get_tag( $post, 'wp:menu_order' );
    280280                $post_type      = $this->get_tag( $post, 'wp:post_type' );
     281                $post_password  = $this->get_tag( $post, 'wp:post_password' );
    281282                $guid           = $this->get_tag( $post, 'guid' );
    282283                $post_author    = $this->get_tag( $post, 'dc:creator' );
    283284
     
    312313
    313314                        $post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
    314315
    315                         $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'post_name', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt', 'guid', 'post_parent', 'menu_order', 'post_type');
     316                        $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'post_name', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password');
    316317                        $comment_post_ID = $post_id = wp_insert_post($postdata);
    317318
    318319                        // Memorize old and new ID.