While working on custom post everybody struggles while sorting the posts by custom taxonomy,

if you add a code for each taxonomy then it will be lengthy. so here is the code for  sort by all taxonomies.

Add it on your functions.php then sorting will be available on all posts screen of your custom post type.