﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
17069,missing get_term_parents() function,thomask,,"we got get_category_parents (http://core.trac.wordpress.org/browser/tags/3.1/wp-includes/category-template.php#L30)
which use $parent = &get_category( $id ); limited to 'category' taxonomy, but there is nothing similar to other taxonomies. IMO we should rewrite this function to be generic and use it as get_term_parents function, the existing get_category_parents would use that get_term_parents, so something like (sorry, i do not know how to use diff) this:


{{{
42	function get_term_parents( $id, $taxonomy, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
43	        $chain = '';
44	        $parent = &get_term( $id, $taxonomy );
45	        if ( is_wp_error( $parent ) )
46	                return $parent;
47	
48	        if ( $nicename )
49	                $name = $parent->slug;
50	        else
51	                $name = $parent->name;
52	
53	        if ( $parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited ) ) {
54	                $visited[] = $parent->parent;
55	                $chain .= get_term_parents( $parent->parent, $link, $separator, $nicename, $visited );
56	        }
57	
58	        if ( $link )
59	                $chain .= '<a href=""' . get_term_link( $parent->term_id ) . '"" title=""' . esc_attr( sprintf( __( ""View all posts in %s"" ), $parent->name ) ) . '"">'.$name.'</a>' . $separator;
60	        else
61	                $chain .= $name.$separator;
62	        return $chain;
63	}
}}}
and
{{{
function get_category_parents( $id, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
   return get_term_parents ($id,'category',$separator,$nicename,$visited);
}
}}}














",enhancement,reopened,normal,Future Release,Taxonomy,3.1,normal,,has-patch,rafaehlers
