From 4ddacfb0ed93019a71451389875f2e5c34c6faf0 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sat, 15 Mar 2008 23:16:28 +0000 Subject: [PATCH] Import mt tags/keywords. See #4472 props shacker. git-svn-id: https://develop.svn.wordpress.org/trunk@7326 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/import/mt.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php index 282bae3ef3..1f575fe897 100644 --- a/wp-admin/import/mt.php +++ b/wp-admin/import/mt.php @@ -23,8 +23,10 @@ class MT_Import { ?>

mt-export.txt in your /wp-content/ directory and then click "Import mt-export.txt"'); ?>

+
+

@@ -222,6 +224,13 @@ class MT_Import { if ( 0 != count($post->categories) ) { wp_create_categories($post->categories, $post_id); } + + // Add tags or keywords + if ( 1 < strlen($post->post_keywords) ) { + // Keywords exist. + printf(__('
Adding tags %s...'), stripslashes($post->post_keywords)); + wp_add_post_tags($post_id, $post->post_keywords); + } } $num_comments = 0; @@ -396,6 +405,8 @@ class MT_Import { $post->extended .= $line; } else if ( 'excerpt' == $context ) { $post->post_excerpt .= $line; + } else if ( 'keywords' == $context ) { + $post->post_keywords .= $line; } else if ( 'comment' == $context ) { $comment->comment_content .= $line; } else if ( 'ping' == $context ) {