hm-core.functions.php
/**
 * Get array of a terms children (across taxonomy)
 *
 * @param object $parent term object
 * @return array
 */
Get array of a terms children (across taxonomy)
@param object $parent term object
@return array
Get array of a terms children ( across taxonomy ) @param object $parent term object @return array
function hm_get_term_children( $parent, $taxonomy = null ) {
	if ( ! is_numeric( $parent ) )
		return false;
	global $wpdb;
	$where = "WHERE tt.parent = $parent";
	if ( $taxonomy )
		$where .= " AND tt.taxonomy = '$taxonomy'";
	$query = "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id $where ORDER BY t.name ASC";
	$terms = $wpdb->get_results( $query );
	return $terms;
}
function hm_get_term_children ( $ parent , $ taxonomy = null ) { if ( ! is_numeric ( $ parent ) ) return false ; global $ wpdb ; $ where = " WHERE tt.parent =  $ parent " ; if ( $ taxonomy ) $ where .= "  AND tt.taxonomy = ' $ taxonomy ' " ; $ query = " SELECT t.*, tt.* FROM  $ wpdb -> terms  AS t INNER JOIN  $ wpdb -> term_taxonomy  AS tt ON t.term_id = tt.term_id  $ where  ORDER BY t.name ASC " ; $ terms = $ wpdb -> get_results ( $ query ) ; return $ terms ; }
Get array of a terms children (across taxonomy)
 @param object $parent term object
 @return array
Get array of a terms children ( across taxonomy ) @param object $parent term object @return array