Check if team performance is array
This commit is contained in:
@@ -137,8 +137,8 @@ class SP_Player_List extends SP_Custom_Post {
|
|||||||
$team_performance = get_post_meta( $event->ID, 'sp_players', true );
|
$team_performance = get_post_meta( $event->ID, 'sp_players', true );
|
||||||
|
|
||||||
// Add all team performance
|
// Add all team performance
|
||||||
if ( $team_performance ): foreach ( $team_performance as $team_id => $players ):
|
if ( is_array( $team_performance ) ): foreach ( $team_performance as $team_id => $players ):
|
||||||
if ( is_array( $players ) ): foreach( $players as $player_id => $player_performance ):
|
if ( is_array( $players ) ): foreach ( $players as $player_id => $player_performance ):
|
||||||
if ( array_key_exists( $player_id, $totals ) && is_array( $totals[ $player_id ] ) ):
|
if ( array_key_exists( $player_id, $totals ) && is_array( $totals[ $player_id ] ) ):
|
||||||
|
|
||||||
$player_performance = sp_array_value( $players, $player_id, array() );
|
$player_performance = sp_array_value( $players, $player_id, array() );
|
||||||
|
|||||||
Reference in New Issue
Block a user