Modularize!

This commit is contained in:
Brian Miyaji
2015-01-28 14:02:35 +11:00
parent aa0eeae6cd
commit 87baaf7288
35 changed files with 1491 additions and 928 deletions

View File

@@ -46,28 +46,26 @@ $common[ __( 'Position', 'sportspress' ) ] = implode( ', ', $position_names );
$data = array_merge( $metrics_before, $common, $metrics_after );
if ( 'team' == get_option( 'sportspress_mode', 'team' ) ) {
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 ( $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 );