From 2ec14d1da3e7d4f6af477d64e8fbf857d3970e94 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Sat, 21 Jun 2014 12:55:18 +1000 Subject: [PATCH] Check if team performance is array --- includes/class-sp-player-list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-sp-player-list.php b/includes/class-sp-player-list.php index 2adc651c..b2eea0b5 100644 --- a/includes/class-sp-player-list.php +++ b/includes/class-sp-player-list.php @@ -137,8 +137,8 @@ class SP_Player_List extends SP_Custom_Post { $team_performance = get_post_meta( $event->ID, 'sp_players', true ); // Add all team performance - if ( $team_performance ): foreach ( $team_performance as $team_id => $players ): - if ( is_array( $players ) ): foreach( $players as $player_id => $player_performance ): + if ( is_array( $team_performance ) ): foreach ( $team_performance as $team_id => $players ): + if ( is_array( $players ) ): foreach ( $players as $player_id => $player_performance ): if ( array_key_exists( $player_id, $totals ) && is_array( $totals[ $player_id ] ) ): $player_performance = sp_array_value( $players, $player_id, array() );