Fix total player statistics calculation in events
This commit is contained in:
@@ -10,13 +10,13 @@ if ( !function_exists( 'sportspress_event_players' ) ) {
|
||||
$stats = (array)get_post_meta( $id, 'sp_players', true );
|
||||
$statistic_labels = sportspress_get_var_labels( 'sp_statistic' );
|
||||
|
||||
$totals = array();
|
||||
|
||||
$output = '';
|
||||
|
||||
foreach( $teams as $key => $team_id ):
|
||||
if ( ! $team_id ) continue;
|
||||
|
||||
$totals = array();
|
||||
|
||||
// Get results for players in the team
|
||||
$players = sportspress_array_between( (array)get_post_meta( $id, 'sp_player', false ), 0, $key );
|
||||
$data = sportspress_array_combine( $players, sportspress_array_value( $stats, $team_id, array() ) );
|
||||
|
||||
Reference in New Issue
Block a user