Get term name and term parent into custom post type permalink

I solved this issue by the following codes where you need to define “rewrite” argument as follows

register_taxonomy( 'map_categories', 'map', array( 'hierarchical' => true, 'label' => 'Catégories', 'query_var' => true, 'rewrite' => array('slug'=>'commerce/artisans','with_front'=>false, 'hierarchical' => true) ) );

You need to understand that ‘hierarchical’ in rewrite actually solve your purpose.

After the update in codes you need to save your permalink structure again. 🙂