Conditional tag affecting taxonomy term and its children?

I have a handy little function that i based on post_is_in_descendant_category function
it expends the is_tax to check if its the term or any of his children

function is_or_descendant_tax( $terms,$taxonomy){
    if (is_tax($taxonomy, $terms)){
            return true;
    }
    foreach ( (array) $terms as $term ) {
        // get_term_children() accepts integer ID only
        $descendants = get_term_children( (int) $term, $taxonomy);
        if ( $descendants && is_tax($taxonomy, $descendants) )
            return true;
    }
    return false;
}

and you use it just the same so instead of:

is_tax('flavor', 'mild');

you put:

is_or_descendant_tax(get_term_by( 'name', 'mild', 'flavor' ), 'flavor');

or if you are using term id instead of name then:

is_or_descendant_tax(12, 'flavor');

and you are set.

tech