Little bit tricky but you can achieve without code.
- Add a new boolean field to taxonomy term.(eg: show link(field name))
- Add three fields like shown in the image.
- Taxonomy term: Name [hidden] -- Exclude from display
- Taxonomy term: Term ID [hidden] -- Exclude from display
Taxonomy term: show link