mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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:
parent
e169d671d2
commit
64f8429a12
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user