get_the_term_list() WP 1.0
Retrieve a post's terms as a list with specified format.
Terms are linked to their respective term listing pages.
Works based on: get_the_terms()
Basis of: get_the_tag_list(), the_terms()
1 time = 0.004471s = very slow | 50000 times = 5.31s = fast | PHP 7.1.2, WP 4.7.3
Hooks from the function
Return
String/false/WP_Error. A list of terms on success, false if there are no terms, WP_Error on failure.
Usage
get_the_term_list( $post_id, $taxonomy, $before, $sep, $after );
- $post_id(int) (required)
- Post ID.
- $taxonomy(string) (required)
- Taxonomy name.
- $before(string)
- String to use before the terms.
Default: '' - $sep(string)
- String to use between the terms.
Default: '' - $after(string)
- String to use after the terms.
Default: ''
Changelog
Since 2.5.0 | Introduced. |
Code of get_the_term_list() get the term list WP 5.6
Related Functions
From tag: List (wp_list)
More from tag: Term (taxonomies terms)
More from category: For posts
- get_object_taxonomies()
- get_objects_in_term()
- get_the_category()
- get_the_category_list()
- get_the_tag_list()
- get_the_tags()
- get_the_taxonomies()