WordPress Version: 4.0
/**
* Display the taxonomies of a post with available options.
*
* This function can be used within the loop to display the taxonomies for a
* post without specifying the Post ID. You can also use it outside the Loop to
* display the taxonomies for a specific post.
*
* The available defaults are:
* 'post' : default is 0. The post ID to get taxonomies of.
* 'before' : default is empty string. Display before taxonomies list.
* 'sep' : default is empty string. Separate every taxonomy with value in this.
* 'after' : default is empty string. Display this after the taxonomies list.
* 'template' : The template to use for displaying the taxonomy terms.
*
* @since 2.5.0
* @uses get_the_taxonomies()
*
* @param array $args Override the defaults.
*/
function the_taxonomies($args = array())
{
$defaults = array(
'post' => 0,
'before' => '',
'sep' => ' ',
'after' => '',
/* translators: %s: taxonomy label, %l: list of term links */
'template' => __('%s: %l.'),
);
$r = wp_parse_args($args, $defaults);
echo $r['before'] . join($r['sep'], get_the_taxonomies($r['post'], $r)) . $r['after'];
}