Skip to content

Commit

Permalink
Use the correct taxonomy and add the 'items_wrap' argument for hybrid…
Browse files Browse the repository at this point in the history
…_get_post_terms().
  • Loading branch information
Justin Tadlock committed Nov 9, 2013
1 parent 0d2d982 commit 7aa6fcd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions functions/template-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,23 @@ function hybrid_get_post_terms( $args = array() ) {
$html = '';

$defaults = array(
'post_id' => get_the_ID(),
'taxonomy' => 'category',
'text' => '%s',
'before' => '<span %s>',
'after' => '</span>',
'post_id' => get_the_ID(),
'taxonomy' => 'category',
'text' => '%s',
'before' => '',
'after' => '',
'items_wrap' => '<span %s>%s</span>',
/* Translators: Separates tags, categories, etc. when displaying a post. */
'sep' => _x( ', ', 'taxonomy terms separator', 'hybrid-core' )
'sep' => _x( ', ', 'taxonomy terms separator', 'hybrid-core' )
);

$args = wp_parse_args( $args, $defaults );

$terms = get_the_term_list( $args['post_id'], $args['taxonomy'], '', $args['sep'], '' );

if ( !empty( $terms ) ) {
$html .= sprintf( $args['before'], hybrid_get_attr( 'entry-terms', 'category' ) );
$html .= sprintf( $args['text'], $terms );
$html .= $args['before'];
$html .= sprintf( $args['items_wrap'], hybrid_get_attr( 'entry-terms', $args['taxonomy'] ), sprintf( $args['text'], $terms ) );
$html .= $args['after'];
}

Expand Down

0 comments on commit 7aa6fcd

Please sign in to comment.