the_terms( int $id, string $taxonomy, string $before = '', string $sep = ', ', string $after = '' )
Display the terms in a list.
Parameters
- $id
-
(Required) Post ID.
- $taxonomy
-
(Required) Taxonomy name.
- $before
-
(Optional) Before list.
Default value: ''
- $sep
-
(Optional) Separate items using this.
Default value: ', '
- $after
-
(Optional) After list.
Default value: ''
Return
(false|void) False on ClassicPress error.
Source
File: wp-includes/category-template.php
function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
$term_list = get_the_term_list( $id, $taxonomy, $before, $sep, $after );
if ( is_wp_error( $term_list ) )
return false;
/**
* Filters the list of terms to display.
*
* @since WP-2.9.0
*
* @param array $term_list List of terms to display.
* @param string $taxonomy The taxonomy name.
* @param string $before String to use before the terms.
* @param string $sep String to use between the terms.
* @param string $after String to use after the terms.
*/
echo apply_filters( 'the_terms', $term_list, $taxonomy, $before, $sep, $after );
}
Changelog
Version | Description |
---|---|
WP-2.5.0 | Introduced. |