ID;
endif;
$leagues = get_the_terms( $id, 'sp_league' );
$output = '';
// Loop through data for each league
foreach ( $leagues as $league ):
$data = sportspress_get_team_columns_data( $id, $league->term_id );
if ( sizeof( $data ) <= 1 )
continue;
if ( sizeof( $leagues ) > 1 )
$output .= '
' . $league->name . '
';
// The first row should be column labels
$labels = $data[0];
// Remove the first row to leave us with the actual data
unset( $data[0] );
$output .= '' . '' . '';
foreach( $labels as $key => $label ):
$output .= '| ' . $label . ' | ';
endforeach;
$output .= '
' . '' . '';
$i = 0;
foreach( $data as $season_id => $row ):
$output .= '';
foreach( $labels as $key => $value ):
$output .= '| ' . sportspress_array_value( $row, $key, '—' ) . ' | ';
endforeach;
$output .= '
';
$i++;
endforeach;
$output .= '' . '
';
endforeach;
return apply_filters( 'sportspress_team_columns', $output );
}
}