Add short name setting to teams and automate display

This commit is contained in:
Brian Miyaji
2018-05-02 12:52:01 +10:00
parent 4b6d23895b
commit bc57f39eba
18 changed files with 44 additions and 50 deletions

View File

@@ -23,7 +23,6 @@ $defaults = array(
'show_leagues' => get_option( 'sportspress_player_show_leagues', 'no' ) == 'yes' ? true : false,
'show_seasons' => get_option( 'sportspress_player_show_seasons', 'no' ) == 'yes' ? true : false,
'show_nationality_flags' => get_option( 'sportspress_player_show_flags', 'yes' ) == 'yes' ? true : false,
'abbreviate_teams' => get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false,
'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
);
@@ -76,7 +75,7 @@ if ( $show_current_teams ):
if ( $current_teams ):
$teams = array();
foreach ( $current_teams as $team ):
$team_name = sp_get_team_name( $team, $abbreviate_teams );
$team_name = sp_team_short_name( $team );
if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
$teams[] = $team_name;
endforeach;
@@ -89,7 +88,7 @@ if ( $show_past_teams ):
if ( $past_teams ):
$teams = array();
foreach ( $past_teams as $team ):
$team_name = sp_get_team_name( $team, $abbreviate_teams );
$team_name = sp_team_short_name( $team );
if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
$teams[] = $team_name;
endforeach;