Add support for sticky posts to the WXR exporter and importer. Fixes #10462 props josephscott.
git-svn-id: http://svn.automattic.com/wordpress/trunk@11774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -378,6 +378,7 @@ class WP_Import {
|
||||
$menu_order = $this->get_tag( $post, 'wp:menu_order' );
|
||||
$post_type = $this->get_tag( $post, 'wp:post_type' );
|
||||
$post_password = $this->get_tag( $post, 'wp:post_password' );
|
||||
$is_sticky = $this->get_tag( $post, 'wp:is_sticky' );
|
||||
$guid = $this->get_tag( $post, 'guid' );
|
||||
$post_author = $this->get_tag( $post, 'dc:creator' );
|
||||
|
||||
@@ -448,6 +449,9 @@ class WP_Import {
|
||||
else {
|
||||
printf(__('Importing post <em>%s</em>...'), stripslashes($post_title));
|
||||
$comment_post_ID = $post_id = wp_insert_post($postdata);
|
||||
if ( $post_id && $is_sticky == 1 )
|
||||
stick_post( $post_id );
|
||||
|
||||
}
|
||||
|
||||
if ( is_wp_error( $post_id ) )
|
||||
|
||||
Reference in New Issue
Block a user