From 2d559695540ac87c7361aa14a37bbcd98152ecf6 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 18 Mar 2014 21:28:35 +1100 Subject: [PATCH] Check if player belongs to leagues to avoid error --- admin/templates/player-statistics.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/admin/templates/player-statistics.php b/admin/templates/player-statistics.php index 7f10e76d..24ff4cad 100644 --- a/admin/templates/player-statistics.php +++ b/admin/templates/player-statistics.php @@ -10,11 +10,11 @@ if ( !function_exists( 'sportspress_player_statistics' ) ) { $output = ''; // Loop through statistics for each league - foreach ( $leagues as $league ): - - $output .= sportspress_player_league_statistics( $league, $id ); - - endforeach; + if ( is_array( $leagues ) ): + foreach ( $leagues as $league ): + $output .= sportspress_player_league_statistics( $league, $id ); + endforeach; + endif; return apply_filters( 'sportspress_player_statistics', $output );