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)
This commit is contained in:
Nabil Kadimi
2018-10-14 16:03:39 +01:00
committed by GitHub
parent 66f8c04dc4
commit 050ca5d67d

View File

@@ -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 = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
endif;
@@ -250,4 +250,4 @@ foreach ( $groups as $group ):
$output .= '</div>';
endforeach;
?>
<?php echo $output; ?>
<?php echo $output; ?>