Prepare for individual mode

This commit is contained in:
Brian Miyaji
2015-01-21 23:51:39 +11:00
parent 1f7c5a35b8
commit a3d20cb72b
3 changed files with 77 additions and 63 deletions

View File

@@ -46,26 +46,30 @@ $common[ __( 'Position', 'sportspress' ) ] = implode( ', ', $position_names );
$data = array_merge( $metrics_before, $common, $metrics_after );
if ( $current_teams ):
$teams = array();
foreach ( $current_teams as $team ):
$team_name = get_the_title( $team );
if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
$teams[] = $team_name;
endforeach;
$label = _n( 'Current Team', 'Current Teams', count( $teams ), 'sportspress' );
$data[ $label ] = implode( ', ', $teams );
endif;
if ( 'teams' == get_option( 'sportspress_mode', 'teams' ) ) {
if ( $current_teams ):
$teams = array();
foreach ( $current_teams as $team ):
$team_name = get_the_title( $team );
if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
$teams[] = $team_name;
endforeach;
$label = _n( 'Current Team', 'Current Teams', count( $teams ), 'sportspress' );
$data[ $label ] = implode( ', ', $teams );
endif;
if ( $past_teams ):
$teams = array();
foreach ( $past_teams as $team ):
$team_name = get_the_title( $team );
if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
$teams[] = $team_name;
endforeach;
$data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
endif;
if ( $past_teams ):
$teams = array();
foreach ( $past_teams as $team ):
$team_name = get_the_title( $team );
if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
$teams[] = $team_name;
endforeach;
$data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
endif;
}
$data = apply_filters( 'sportspress_player_details', $data, $id );
$output = '<div class="sp-template sp-template-player-details sp-template-details"><div class="sp-list-wrapper"><dl class="sp-player-details">';