Make WordPress Core

Changeset 7965


Ignore:
Timestamp:
05/20/2008 10:22:21 PM (16 years ago)
Author:
ryan
Message:

Export and import post excerpts. Props kartik_subbarao. fixes #5555

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/wordpress.php

    r7883 r7965  
    358358        $post_author    = $this->get_tag( $post, 'dc:creator' );
    359359
     360        $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
     361        $post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt);
     362        $post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
     363        $post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
     364
    360365        $post_content = $this->get_tag( $post, 'content:encoded' );
    361366        $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
     
    405410            $post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
    406411
    407             $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');
     412            $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password');
    408413            if ($post_type == 'attachment') {
    409414                $remote_url = $this->get_tag( $post, 'wp:attachment_url' );
  • trunk/wp-admin/includes/export.php

    r7645 r7965  
    202202<description></description>
    203203<content:encoded><?php echo wxr_cdata( apply_filters('the_content_export', $post->post_content) ); ?></content:encoded>
     204<excerpt:encoded><?php echo wxr_cdata( apply_filters('the_excerpt_export', $post->post_excerpt) ); ?></excerpt:encoded>
    204205<wp:post_id><?php echo $post->ID; ?></wp:post_id>
    205206<wp:post_date><?php echo $post->post_date; ?></wp:post_date>
Note: See TracChangeset for help on using the changeset viewer.