mirror of
git://develop.git.wordpress.org/
synced 2025-02-24 16:43:06 +01:00
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:
parent
23909c920b
commit
ceea4bb3fe
@ -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…
x
Reference in New Issue
Block a user