From fd286c97fb4dafb55024f26c7d9ef33b38aa5102 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 7 Jan 2014 13:43:57 +1100 Subject: [PATCH] Fix admin team display loop --- admin/actions/manage-posts-custom-column.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/actions/manage-posts-custom-column.php b/admin/actions/manage-posts-custom-column.php index 0f93408b..e377f048 100644 --- a/admin/actions/manage-posts-custom-column.php +++ b/admin/actions/manage-posts-custom-column.php @@ -11,10 +11,10 @@ function sp_manage_posts_custom_column( $column, $post_id ) { case 'sp_team': $post_type = get_post_type( $post ); $teams = get_post_meta ( $post_id, 'sp_team', false ); - unset( $teams[0] ); if ( $post_type == 'sp_event' ): $results = get_post_meta( $post_id, 'sp_results', true ); foreach( $teams as $team_id ): + if ( ! $team_id ) continue; $team = get_post( $team_id ); $outcome_slug = sp_array_value( sp_array_value( $results, $team_id, null ), 'outcome', null ); @@ -30,6 +30,7 @@ function sp_manage_posts_custom_column( $column, $post_id ) { elseif ( $post_type == 'sp_player' ): $results = get_post_meta( $post_id, 'sp_results', true ); foreach( $teams as $team_id ): + if ( ! $team_id ) continue; $team = get_post( $team_id ); $outcome_slug = sp_array_value( sp_array_value( $results, $team_id, null ), 'outcome', null );