Ticket #14156: 14156.patch
| File 14156.patch, 956 bytes (added by , 11 years ago) |
|---|
-
src/wp-includes/taxonomy.php
4322 4322 * 4323 4323 * @param object|int|string $term The term object, ID, or slug whose link will be retrieved. 4324 4324 * @param string $taxonomy Optional. Taxonomy. Default empty. 4325 * @param string $field Either 'slug', 'name', or 'id' 4325 4326 * @return string|WP_Error HTML link to taxonomy term archive on success, WP_Error if term does not exist. 4326 4327 */ 4327 function get_term_link( $term, $taxonomy = '' ) {4328 function get_term_link( $term, $taxonomy = '', $field = 'slug' ) { 4328 4329 global $wp_rewrite; 4329 4330 4330 4331 if ( !is_object($term) ) { … … 4331 4332 if ( is_int($term) ) { 4332 4333 $term = get_term($term, $taxonomy); 4333 4334 } else { 4334 $term = get_term_by( 'slug', $term, $taxonomy);4335 $term = get_term_by( $field, $term, $taxonomy ); 4335 4336 } 4336 4337 } 4337 4338