Fix category renaming. fixes #4415 see #4189

git-svn-id: http://svn.automattic.com/wordpress/trunk@5658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-06-06 16:10:52 +00:00
parent d5f3d0c2d7
commit bac1fccf3a

View File

@ -216,8 +216,6 @@ function wp_update_term( $term, $taxonomy, $args = array() ) {
$args = wp_parse_args($args, $defaults);
extract($args);
$parent = (int) $parent;
if ( empty($slug) )
$slug = sanitize_title($name);
else
@ -238,7 +236,7 @@ function wp_update_term( $term, $taxonomy, $args = array() ) {
$wpdb->query("UPDATE $wpdb->terms SET name = '$name', slug = '$slug', term_group = '$term_group' WHERE term_id = '$term_id'");
if ( empty($slug) ) {
$slug = sanitize_title($slug, $term_id);
$slug = sanitize_title($name, $term_id);
$wpdb->query("UPDATE $wpdb->terms SET slug = '$slug' WHERE term_id = '$term_id'");
}