Ticket #27238: 27238.3.diff
File 27238.3.diff, 1.8 KB (added by , 11 years ago) |
---|
-
src/wp-includes/taxonomy.php
3173 3173 * 'before' : default is empty string. Display before taxonomies list. 3174 3174 * 'sep' : default is empty string. Separate every taxonomy with value in this. 3175 3175 * 'after' : default is empty string. Display this after the taxonomies list. 3176 * 'template' : The template to use for displaying the taxonomy terms. 3176 * 'template' : The template to use for displaying the taxonomy term list. 3177 * 'term_template' : The template to use for displaying the individual taxonomy terms. 3177 3178 * 3178 3179 * @since 2.5.0 3179 3180 * @uses get_the_taxonomies() … … 3186 3187 'before' => '', 3187 3188 'sep' => ' ', 3188 3189 'after' => '', 3189 'template' => '%s: %l.' 3190 'template' => '%s: %l.', 3191 'term_template' => '<a href="%s$s">%2$s</a>', 3190 3192 ); 3191 3193 3192 3194 $r = wp_parse_args( $args, $defaults ); … … 3212 3214 3213 3215 $args = wp_parse_args( $args, array( 3214 3216 'template' => '%s: %l.', 3217 'term_template' => '<a href="%s$s">%2$s</a>', 3215 3218 ) ); 3216 3219 extract( $args, EXTR_SKIP ); 3217 3220 … … 3228 3231 $t['args'] = array(); 3229 3232 if ( empty($t['template']) ) 3230 3233 $t['template'] = $template; 3234 if ( empty($t['term_template']) ) 3235 $t['term_template'] = $term_template; 3231 3236 3232 3237 $terms = get_object_term_cache($post->ID, $taxonomy); 3233 3238 if ( false === $terms ) … … 3236 3241 $links = array(); 3237 3242 3238 3243 foreach ( $terms as $term ) 3239 $links[] = "<a href='" . esc_attr( get_term_link($term) ) . "'>$term->name</a>";3244 $links[] = wp_sprintf( $t['term_template'], esc_attr( get_term_link($term) ), $term->name ); 3240 3245 3241 3246 if ( $links ) 3242 3247 $taxonomies[$taxonomy] = wp_sprintf($t['template'], $t['label'], $links, $terms);