- if ( ! isset($cat1->term_id) )
- $cat1 = &get_category( $cat1 );
- if ( ! isset($cat2->parent) )
- $cat2 = &get_category( $cat2 );
-
- if ( empty($cat1->term_id) || empty($cat2->parent) )
- return false;
- if ( $cat2->parent == $cat1->term_id )
- return true;
-
- return cat_is_ancestor_of( $cat1, get_category( $cat2->parent ) );