Add current team indicator in player admin screen

This commit is contained in:
Brian Miyaji
2014-02-15 16:51:12 +11:00
parent 0ffd898445
commit 443c0e5def
3 changed files with 13 additions and 6 deletions

View File

@@ -69,12 +69,15 @@ function sportspress_manage_posts_custom_column( $column, $post_id ) {
echo '<br>';
endforeach;
elseif ( $post_type == 'sp_player' ):
$results = get_post_meta( $post_id, 'sp_results', true );
$current_team = get_post_meta( $post_id, 'sp_current_team', true );
foreach( $teams as $team_id ):
if ( ! $team_id ) continue;
$team = get_post( $team_id );
$outcome_slug = sportspress_array_value( sportspress_array_value( $results, $team_id, null ), 'outcome', null );
echo $team->post_title . '<br>';
echo $team->post_title;
if ( $team_id == $current_team ):
echo ' (' . __( 'Current Team', 'sportspress' ) . ')';
endif;
echo '<br>';
endforeach;
else:
foreach( $teams as $team_id ):