Function: get_term_link

get_term_link( object | integer | string $term, string $taxonomy )

Generate a permalink for a taxonomy term archive.

Shortcut: gtl

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.

Parameters

Name Type(s) Default Value Description
$term object | integer | string

The term object, ID, or slug whose link will be retrieved.

$taxonomy string ''

Optional. Taxonomy. Default empty.

Returns

string | WP_Error

HTML link to taxonomy term archive on success, WP_Error if term does not exist.

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.