I want the slug to be recreated every time the term name is updated so it accurately reflects the name.
wp_update_term(10, 'artists', array('name' => 'my new name'));
The documentation for wp_update_term says:
If the 'slug' argument in $args is missing, then the 'name' in $args will be used. It should also be noted that if you set 'slug' and it isn't unique then a WP_Error will be passed back. If you don't pass any slug, then a unique one will be created for you.
The slug, which already exists and is already set to "my-old-name"
does not update to
"my-new-name"
when I run the above function.
Is this intended? Do I need to manually code the slug generation and change it myself in the arguments?