Ticket #13081: get_term_link.diff
File get_term_link.diff, 1.9 KB (added by , 14 years ago) |
---|
-
wp-includes/taxonomy.php
2363 2363 * @since 2.5.0 2364 2364 * 2365 2365 * @param object|int|string $term 2366 * @param string $taxonomy 2366 * @param string $taxonomy (optional if $term is object) 2367 2367 * @return string HTML link to taxonomy term archive 2368 2368 */ 2369 function get_term_link( $term, $taxonomy ) {2369 function get_term_link( $term, $taxonomy = '') { 2370 2370 global $wp_rewrite; 2371 2371 2372 2372 if ( !is_object($term) ) { … … 2383 2383 if ( is_wp_error( $term ) ) 2384 2384 return $term; 2385 2385 2386 $taxonomy = $term->taxonomy; 2387 2386 2388 // use legacy functions for core taxonomies until they are fully plugged in 2387 2389 if ( $taxonomy == 'category' ) 2388 2390 return get_category_link((int) $term->term_id); … … 2479 2481 $links = array(); 2480 2482 2481 2483 foreach ( $terms as $term ) 2482 $links[] = "<a href='" . esc_attr( get_term_link($term, $taxonomy)) . "'>$term->name</a>";2484 $links[] = "<a href='" . esc_attr( get_term_link($term) ) . "'>$term->name</a>"; 2483 2485 2484 2486 if ( $links ) 2485 2487 $taxonomies[$taxonomy] = wp_sprintf($t['template'], $t['label'], $links, $terms); -
wp-includes/classes.php
1436 1436 function start_el(&$output, $category, $depth, $args) { 1437 1437 extract($args); 1438 1438 1439 $cat_name = esc_attr( $category->name );1439 $cat_name = esc_attr( $category->name ); 1440 1440 $cat_name = apply_filters( 'list_cats', $cat_name, $category ); 1441 $link = '<a href="' . get_term_link( $category, $category->taxonomy) . '" ';1441 $link = '<a href="' . esc_attr( get_term_link($category) ) . '" '; 1442 1442 if ( $use_desc_for_title == 0 || empty($category->description) ) 1443 1443 $link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"'; 1444 1444 else