Ticket #30705: category-template.diff
File category-template.diff, 1.2 KB (added by , 9 years ago) |
---|
-
category-template.php
1278 1278 * @param string $before Optional. Before list. 1279 1279 * @param string $sep Optional. Separate items using this. 1280 1280 * @param string $after Optional. After list. 1281 * @param string $term_template Optional. Template for displaying a single term in the list. Default is the term name linked to its archive 1281 1282 * @return string|bool|WP_Error A list of terms on success, false if there are no terms, WP_Error on failure. 1282 1283 */ 1283 function get_the_term_list( $id, $taxonomy, $before = '', $sep = '', $after = '' ) {1284 function get_the_term_list( $id, $taxonomy, $before = '', $sep = '', $after = '', $term_template = '<a href="%1$s">%2$s</a>' ) { 1284 1285 $terms = get_the_terms( $id, $taxonomy ); 1285 1286 1286 1287 if ( is_wp_error( $terms ) ) … … 1293 1294 $link = get_term_link( $term, $taxonomy ); 1294 1295 if ( is_wp_error( $link ) ) 1295 1296 return $link; 1296 $term_links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>';1297 $term_links[] = wp_sprintf( $term_template, esc_attr( get_term_link($term) ), $term->name ); 1297 1298 } 1298 1299 1299 1300 /**