WordPress is_tree function to get ancestor