Custom Taxonomies in body class with parent slug

From the above function you queried all the taxonomies. Not specific.

I mean it’s not only for your custom taxonomy. Working for the whole.