WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/07/2010 04:29:00 AM (9 years ago)
Author:
markjaquith
Message:

Make the second (taxonomy) parameter for get_term_link() optional if you pass in a term object as the first argument (which has the taxonomy in it). fixes #13081. props scribu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r15583 r15586  
    24822482 *
    24832483 * @param object|int|string $term
    2484  * @param string $taxonomy
     2484 * @param string $taxonomy (optional if $term is object)
    24852485 * @return string HTML link to taxonomy term archive
    24862486 */
    2487 function get_term_link( $term, $taxonomy ) {
     2487function get_term_link( $term, $taxonomy = '') {
    24882488    global $wp_rewrite;
    24892489
     
    25012501    if ( is_wp_error( $term ) )
    25022502        return $term;
     2503
     2504    $taxonomy = $term->taxonomy;
    25032505
    25042506    // use legacy functions for core taxonomies until they are fully plugged in
     
    25982600
    25992601        foreach ( $terms as $term )
    2600             $links[] = "<a href='" . esc_attr(get_term_link($term, $taxonomy)) . "'>$term->name</a>";
     2602            $links[] = "<a href='" . esc_attr( get_term_link($term) ) . "'>$term->name</a>";
    26012603
    26022604        if ( $links )
Note: See TracChangeset for help on using the changeset viewer.