I would just copy the function from core and put in your theme's functions.php. Change the function name and make changes so it gets the terms from the custom taxonomy. Something like this [untested]:
function get_custom_category_parents( $id, $taxonomy = false, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
if(!($taxonomy && is_taxonomy_hierarchical( $taxonomy )))
return '';
$chain = '';
// $parent = get_category( $id );
$parent = get_term( $id, $taxonomy);
if ( is_wp_error( $parent ) )
return $parent;
if ( $nicename )
$name = $parent->slug;
else
$name = $parent->name;
if ( $parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited ) ) {
$visited[] = $parent->parent;
// $chain .= get_category_parents( $parent->parent, $link, $separator, $nicename, $visited );
$chain .= get_custom_category_parents( $parent->parent, $taxonomy, $link, $separator, $nicename, $visited );
}
if ( $link ) {
// $chain .= '<a href="' . esc_url( get_category_link( $parent->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$name.'</a>' . $separator;
$chain .= '<a href="' . esc_url( get_term_link( (int) $parent->term_id, $taxonomy ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$name.'</a>' . $separator;
} else {
$chain .= $name.$separator;
}
return $chain;
}
Now you can call this function from your template files like this:
<?php
$category = wp_get_object_terms( $post->ID, 'portfolio-category', array('fields' => 'ids') );
if($category)
echo '<li>'.get_custom_category_parents( $category[0], 'portfolio-category', TRUE, '', FALSE ).'</li>';
?>