Upgrade fixes. see #4189

git-svn-id: https://develop.svn.wordpress.org/trunk@5643 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-06-03 18:57:14 +00:00
parent ce17f71ccb
commit 7fd0cb8c83
1 changed files with 10 additions and 3 deletions

View File

@ -607,22 +607,29 @@ function upgrade_230() {
$wpdb->query("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES ('$term_id', '$name', '$slug', '$term_group')");
$count = 0;
if ( !empty($category->category_count) ) {
$count = (int) $category->category_count;
$taxonomy = 'category';
$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
} else if ( !empty($category->link_count) ) {
}
if ( !empty($category->link_count) ) {
$count = (int) $category->link_count;
$taxonomy = 'link_category';
$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
} else if ( !empty($category->tag_count) ) {
}
if ( !empty($category->tag_count) ) {
$count = (int) $category->tag_count;
$taxonomy = 'post_tag';
$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
} else {
}
if ( empty($count) ) {
$count = 0;
$taxonomy = 'category';
$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");