public static function handle_term_query($taxonomies, $args, $TermClass)
{
if (!isset($args['hide_empty'])) {
$args['hide_empty'] = false;
}
if (isset($args['term_id']) && is_int($args['term_id'])) {
$args['term_id'] = array($args['term_id']);
}
if (isset($args['term_id'])) {
$args['include'] = $args['term_id'];
}
$terms = get_terms($taxonomies, $args);
foreach ($terms as &$term) {
$term = new $TermClass($term->term_id, $term->taxonomy);
}
return $terms;
}