Filter teams arrays to remove any 0 or null values

This commit is contained in:
savvasha
2018-08-20 18:14:39 +03:00
committed by GitHub
parent be2c026f3f
commit 4b8dbaec49

View File

@@ -71,7 +71,7 @@ endif;
$data = array_merge( $metrics_before, $common, $metrics_after ); $data = array_merge( $metrics_before, $common, $metrics_after );
if ( $show_current_teams ): if ( $show_current_teams ):
$current_teams = $player->current_teams(); $current_teams = array_filter( $player->current_teams() );
if ( $current_teams ): if ( $current_teams ):
$teams = array(); $teams = array();
foreach ( $current_teams as $team ): foreach ( $current_teams as $team ):
@@ -84,7 +84,7 @@ if ( $show_current_teams ):
endif; endif;
if ( $show_past_teams ): if ( $show_past_teams ):
$past_teams = $player->past_teams(); $past_teams = array_filter( $player->past_teams() );
if ( $past_teams ): if ( $past_teams ):
$teams = array(); $teams = array();
foreach ( $past_teams as $team ): foreach ( $past_teams as $team ):