So I was noticing that every time I changed a description of a category, the term_id was resetting... even though I wasn't changing the term, or the name (the term text)...
I debugged it a little, and saw that in mu.php, there is this code:
function sync_slugs( $term, $taxonomy, $args ) {
$args[ 'slug' ] = sanitize_title( $args[ 'name' ] );
return $args;
}
add_filter( 'pre_update_term', 'sync_slugs', 10, 3 );
Sure, this looks innocent enough, but it turns out that the "name" for some of my categories are identical, (they are children of other parents, which is allowed, unless you're George Forman, and then all your children have the same name)...
But since this filter resets the slug, the normal processing for term updates says "wait a second, you can't have duplicate slugs" and so it comes up with a new slug name... and as a result a new term is added, and the term_id bounces around.
This seems like a bug, certainly it's making my life difficult, and at the minimum it seems to be doing unnecessary work in the db.
Thoughts?