Abbreviate team names independently

This commit is contained in:
Brian Miyaji
2016-04-13 23:59:21 +10:00
parent 99c29a0766
commit 6ba028f2cf
11 changed files with 31 additions and 26 deletions

View File

@@ -19,6 +19,7 @@ $defaults = array(
'show_past_teams' => get_option( 'sportspress_staff_show_past_teams', 'yes' ) == 'yes' ? true : false,
'show_nationality_flags' => get_option( 'sportspress_staff_show_flags', 'yes' ) == 'yes' ? true : false,
'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
'abbreviate_teams' => get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false,
);
extract( $defaults, EXTR_SKIP );
@@ -49,7 +50,7 @@ endif;
if ( $show_current_teams && $current_teams ):
$teams = array();
foreach ( $current_teams as $team ):
$team_name = get_the_title( $team );
$team_name = sp_get_team_name( $team, $abbreviate_teams );
if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
$teams[] = $team_name;
endforeach;
@@ -59,7 +60,7 @@ endif;
if ( $show_past_teams && $past_teams ):
$teams = array();
foreach ( $past_teams as $team ):
$team_name = get_the_title( $team );
$team_name = sp_get_team_name( $team, $abbreviate_teams );
if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
$teams[] = $team_name;
endforeach;