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

git-svn-id: https://develop.svn.wordpress.org/trunk@5252 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
rob1n 2007-04-12 05:55:34 +00:00
parent 23909c920b
commit ceea4bb3fe

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);
}
}