I have a similar problem from drkknght. Not exactly what fritzthecat is saying.
I have multiple subcategories in which I'd like create an "upper" level to work around my posts organization, custom taxonomies it is. So I created a parent category (with the custom taxonomy name) to all categories that I want to separate the term I want to convert to taxonomies.
So far so good, I have the function working but the wp_update_term function doesn't seem to update the term to a new taxonomy.
Here is the function:
migrate_terms(123, 'new-taxonomy');
function migrate_terms($parent_id, $taxonomy) {
$child_terms = get_term_children($parent_id, 'category');
foreach($child_terms as $child_term) {
$term = get_term_by('id', $child_term, 'category');
$args = array(
'taxonomy' => $taxonomy
);
// remove parent because it is now useless
if($term->parent == $parent_id)
$update = wp_update_term($term->term_id, $term->taxonomy, array('parent' => 0));
// update term to new taxonomy
$update = wp_update_term($term->term_id, $term->taxonomy, $args);
}
}
The problem is right on this example:
wp_update_term(123, 'category', array('taxonomy' => 'new-taxonomy'));
It returns successfully but doesn't change the term's taxonomy. Any ideas?