Oops. Patch didn't apply cleanly. fixes #1750

git-svn-id: https://develop.svn.wordpress.org/trunk@2947 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-10-13 18:59:10 +00:00
parent 5399c5f576
commit e4d15f3596
1 changed files with 2 additions and 4 deletions

View File

@ -107,18 +107,16 @@ function wp_insert_category($catarr) {
$category_parent = 0;
if (!$update) {
$query = "INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')";
$wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')");
$cat_ID = $wpdb->insert_id;
} else {
$query = "UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent' WHERE cat_ID = '$cat_ID'";
$wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent' WHERE cat_ID = '$cat_ID'");
}
if ( $category_nicename == '' ) {
$category_nicename = sanitize_title($cat_name, $cat_ID );
$wpdb->query( "UPDATE $wpdb->categories SET category_nicename = '$category_nicename' WHERE cat_ID = '$cat_ID'" );
}
$result = $wpdb->query($query);
if ($update) {
do_action('edit_category', $cat_ID);