Ticket #16521: 16521.2.diff
| File 16521.2.diff, 2.0 KB (added by , 15 years ago) |
|---|
-
wp-includes/taxonomy.php
2815 2815 * 2816 2816 * @param object|int|string $term 2817 2817 * @param string $taxonomy (optional if $term is object) 2818 * @return string |WP_Error HTML link to taxonomy term archive on success, WP_Errorif term does not exist.2818 * @return string HTML link to taxonomy term archive on success, empty string if term does not exist. 2819 2819 */ 2820 2820 function get_term_link( $term, $taxonomy = '') { 2821 2821 global $wp_rewrite; … … 2832 2832 $term = new WP_Error('invalid_term', __('Empty Term')); 2833 2833 2834 2834 if ( is_wp_error( $term ) ) 2835 return $term;2835 return ''; 2836 2836 2837 2837 $taxonomy = $term->taxonomy; 2838 2838 -
wp-includes/category-template.php
12 12 * @since 1.0.0 13 13 * @see get_term_link() 14 14 * 15 * @param int $category _id Category ID.16 * @return string |WP_Error Link on success, WP_Errorif category does not exist.15 * @param int $category Category ID, object, or slug. 16 * @return string Link on success, empty string if category does not exist. 17 17 */ 18 function get_category_link( $category _id) {19 return get_term_link( (int)$category_id, 'category');18 function get_category_link( $category ) { 19 return get_term_link( $category, 'category' ); 20 20 } 21 21 22 22 /** … … 964 964 * @since 2.3.0 965 965 * @see get_term_link() 966 966 * 967 * @param int $tag_id Tag (term) ID.968 * @return string |WP_Error Link on success, WP_Errorif tag does not exist.967 * @param object|string|int $tag Tag ID, object, or slug. 968 * @return string Link on success, empty string if tag does not exist. 969 969 */ 970 function get_tag_link( $tag _id) {971 return get_term_link( (int)$tag_id, 'post_tag');970 function get_tag_link( $tag ) { 971 return get_term_link( $tag, 'post_tag' ); 972 972 } 973 973 974 974 /**