Prepare for individual mode
This commit is contained in:
@@ -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">';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user