wp_unique_term_slug() never uses the query excluding the given term_id
|Reported by:||duck_||Owned by:|
$args is an undefined variable so the not-empty check always fails. See .
We should either change this to $term->term_id or remove it completely as it has never been used. The former will require a bit more investigation to ensure that its addition now has no unintended consequences.