Changeset 17443
- Timestamp:
- 02/10/2011 09:48:40 PM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
-
category-template.php (modified) (2 diffs)
-
taxonomy.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category-template.php
r17437 r17443 13 13 * @see get_term_link() 14 14 * 15 * @param int $category Category ID, object, or slug.15 * @param int|object $category Category ID or object. 16 16 * @return string Link on success, empty string if category does not exist. 17 17 */ 18 18 function get_category_link( $category ) { 19 return get_term_link( $category, 'category' ); 19 if ( ! is_object( $category ) ) 20 $category = (int) $category; 21 22 $category = get_term_link( $category, 'category' ); 23 24 if ( is_wp_error( $category ) ) 25 return ''; 26 27 return $category; 20 28 } 21 29 … … 965 973 * @see get_term_link() 966 974 * 967 * @param object|string|int $tag Tag ID, object, or slug.975 * @param int|object $tag Tag ID or object. 968 976 * @return string Link on success, empty string if tag does not exist. 969 977 */ 970 978 function get_tag_link( $tag ) { 971 return get_term_link( $tag, 'post_tag' ); 979 if ( ! is_object( $tag ) ) 980 $tag = (int) $tag; 981 982 $tag = get_term_link( $tag, 'post_tag' ); 983 984 if ( is_wp_error( $tag ) ) 985 return ''; 986 987 return $tag; 972 988 } 973 989 -
trunk/wp-includes/taxonomy.php
r17437 r17443 2816 2816 * @param object|int|string $term 2817 2817 * @param string $taxonomy (optional if $term is object) 2818 * @return string HTML link to taxonomy term archive on success, empty stringif term does not exist.2818 * @return string|WP_Error HTML link to taxonomy term archive on success, WP_Error if term does not exist. 2819 2819 */ 2820 2820 function get_term_link( $term, $taxonomy = '') { … … 2833 2833 2834 2834 if ( is_wp_error( $term ) ) 2835 return '';2835 return $term; 2836 2836 2837 2837 $taxonomy = $term->taxonomy;
Note: See TracChangeset
for help on using the changeset viewer.