Function: get_the_term_list

get_the_term_list( integer $id, string $taxonomy, string $before, string $sep, string $after )

Retrieve a post's terms as a list with specified format.

Shortcut: gttl

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
$id integer

Post ID.

$taxonomy string

Taxonomy name.

$before string ''

Optional. Before list.

$sep string ''

Optional. Separate items using this.

$after string ''

Optional. After list.

Returns

string | false | WP_Error

A list of terms on success, false if there are no terms, WP_Error on failure.

WordPress Developer Newsletter

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