' . '' . '';
// The first row should be column labels
$labels = $data[0];
// Remove the first row to leave us with the actual data
unset( $data[0] );
foreach( $labels as $label ):
$output .= '| ' . $label . ' | ';
endforeach;
$output .= '
' . '' . '' . '
';
$i = 1;
foreach( $data as $team_id => $row ):
$output .= '';
// Thumbnail and name as link
$permalink = get_post_permalink( $team_id );
$thumbnail = get_the_post_thumbnail( $team_id, 'sp_icon' );
$output .= '| ' . $i . '. ' . ( $thumbnail ? $thumbnail . ' ' : '' ) . '' . sportspress_array_value( $row, 'name', ' ' ) . ' | ';
foreach( $labels as $key => $value ):
if ( $key == 'name' )
continue;
$output .= '' . sportspress_array_value( $row, $key, '—' ) . ' | ';
endforeach;
$output .= '
';
$i++;
endforeach;
$output .= '' . '';
return $output;
}
}
if ( !function_exists( 'sportspress_player_list' ) ) {
function sportspress_player_list( $id ) {
$data = sportspress_get_list( $id );
$output = '' . '' . '';
// The first row should be column labels
$labels = $data[0];
// Remove the first row to leave us with the actual data
unset( $data[0] );
foreach( $labels as $label ):
$output .= '| ' . $label . ' | ';
endforeach;
$output .= '
' . '' . '' . '';
foreach( $data as $player_id => $row ):
$output .= '';
// Name as link
$permalink = get_post_permalink( $player_id );
$number = get_post_meta( $player_id, 'sp_number', true );
$output .= '| ' . ( $number ? $number . '. ' : '' ) . '' . sportspress_array_value( $row, 'name', ' ' ) . ' | ';
foreach( $labels as $key => $value ):
if ( $key == 'name' )
continue;
$output .= '' . sportspress_array_value( $row, $key, '—' ) . ' | ';
endforeach;
$output .= '
';
endforeach;
$output .= '' . '
';
return $output;
}
}