From 050ca5d67dc99e96753b5c0e830ba6d837c87aa0 Mon Sep 17 00:00:00 2001 From: Nabil Kadimi Date: Sun, 14 Oct 2018 16:03:39 +0100 Subject: [PATCH] Fix team name in player list When the player doesn't have a team, the player list shouldn't use the post title as the team name but should display nothing (empty string) --- templates/player-list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/player-list.php b/templates/player-list.php index ab3780ab..c88c6258 100644 --- a/templates/player-list.php +++ b/templates/player-list.php @@ -194,7 +194,7 @@ foreach ( $groups as $group ): if ( array_key_exists( 'team', $labels ) ): $team = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_current_team', true ) ); - $team_name = sp_team_short_name( $team ); + $team_name = $team ? sp_team_short_name( $team ) : ''; if ( $link_teams && false !== get_post_status( $team ) ): $team_name = '' . $team_name . ''; endif; @@ -250,4 +250,4 @@ foreach ( $groups as $group ): $output .= ''; endforeach; ?> - \ No newline at end of file +