id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses
21639,wp_update_term doesn't honor taxonomy,Whissi,,"Hi,
I wanted to programmatically change my categories. This is the code I would use:
{{{
#!php
[...]
foreach ( $categories_to_rename AS $category ) {
$cat_ID = (int) $category->cat_ID;
if ( $cat_ID === 1 ) {
// Skip default category
continue;
}
$updatedCategory = array();
$updatedCategory['slug'] = getTheNewCategoryNameFromSomewhere( $cat_ID );
$update_response = wp_update_term( $cat_ID, 'category', $updatedCategory )
if ( is_wp_error( $update_response ) )
return $update_response;
}
[...]
}}}
After that I noticed, that the slug of some tags were changed, too.
I looked into the database and noticed, that some tags shared the same term with a category. Because I updated the slug, which is stored in the terms table, the tag name was ""updated"", too.
This is something I don't expect. When I call an update on ""category"", I don't expect that something else will update, too.
When it is allowed, that a category and a tag will share the same term, this sharing should end when you update just one part.",defect (bug),closed,normal,,Taxonomy,2.3,normal,duplicate,,,