Ticket #14156: get_term_link.patch
| File get_term_link.patch, 721 bytes (added by , 16 years ago) |
|---|
-
taxonomy.php
2473 2473 * 2474 2474 * @param object|int|string $term 2475 2475 * @param string $taxonomy 2476 * @param string $field Either 'slug', 'name', or 'id' 2476 2477 * @return string HTML link to taxonomy term archive 2477 2478 */ 2478 function get_term_link( $term, $taxonomy ) {2479 function get_term_link( $term, $taxonomy, $field = 'slug' ) { 2479 2480 global $wp_rewrite; 2480 2481 2481 2482 if ( !is_object($term) ) { 2482 2483 if ( is_int($term) ) { 2483 2484 $term = &get_term($term, $taxonomy); 2484 2485 } else { 2485 $term = &get_term_by( 'slug', $term, $taxonomy);2486 $term = &get_term_by($field, $term, $taxonomy); 2486 2487 } 2487 2488 } 2488 2489