Summery Summery
Display the terms in a list.
Syntax Syntax
Parameters 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 Return
(false|void) False on WordPress error.
Source Source
File: wp-includes/category-template.php
$term_id = $term->term_id;
$defaults = array(
'format' => 'name',
'separator' => '/',
'link' => true,
'inclusive' => true,
);
$args = wp_parse_args( $args, $defaults );
foreach ( array( 'link', 'inclusive' ) as $bool ) {
$args[ $bool ] = wp_validate_boolean( $args[ $bool ] );
}
$parents = get_ancestors( $term_id, $taxonomy, 'taxonomy' );
if ( $args['inclusive'] ) {
array_unshift( $parents, $term_id );
}
Advertisement
Changelog Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |