okay, sorry, I didn’t do a test and after looking at the code I realize my mistake.
The first part where I put “$term->term_slug” should have been the “Taxonomy Slug” for your taxonomy.
'my-tax_'.$term->term_id
which is, of course, what that code you posted is doing. My brain is just turning to mush 😛