Some fixes for another fix. Props takayukister. fixes #4040

git-svn-id: http://svn.automattic.com/wordpress/trunk@5252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-04-12 05:55:34 +00:00
parent e169d671d2
commit 64f8429a12

View File

@ -296,12 +296,11 @@ class WP_Import {
foreach ($categories as $category) {
$cat_ID = (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name = '$category'");
if ($cat_ID == 0) {
if ($cat_ID = wp_insert_category(array('cat_name' => $category))) {
$post_cats[] = $cat_ID;
}
$cat_ID = wp_insert_category(array('cat_name' => $category));
}
$post_cats[] = $cat_ID;
}
wp_set_post_categories($post_ID, $post_cats);
wp_set_post_categories($post_id, $post_cats);
}
}