Make WordPress Core


Ignore:
Timestamp:
02/10/2011 08:17:54 PM (13 years ago)
Author:
ryan
Message:

Return empty strings instead of WP_Errro from get_category_link(), get_term_link(), and get_tag_link() when passed an invalid term. Clarify phpdoc. Props nacin. fixes #16521 for trunk

File:
1 edited

Legend:

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

    r17372 r17437  
    28162816 * @param object|int|string $term
    28172817 * @param string $taxonomy (optional if $term is object)
    2818  * @return string|WP_Error HTML link to taxonomy term archive on success, WP_Error if term does not exist.
     2818 * @return string HTML link to taxonomy term archive on success, empty string if term does not exist.
    28192819 */
    28202820function get_term_link( $term, $taxonomy = '') {
     
    28332833
    28342834    if ( is_wp_error( $term ) )
    2835         return $term;
     2835        return '';
    28362836
    28372837    $taxonomy = $term->taxonomy;
Note: See TracChangeset for help on using the changeset viewer.