From 987a266cb25ba0028093d6418ce7ba3fb4632b6a Mon Sep 17 00:00:00 2001 From: Nabil Kadimi Date: Tue, 8 May 2018 15:00:49 +0100 Subject: [PATCH] Make sure $leagues is an array of non-empty values --- templates/player-statistics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/player-statistics.php b/templates/player-statistics.php index f7ed0463..8ac44698 100644 --- a/templates/player-statistics.php +++ b/templates/player-statistics.php @@ -19,7 +19,7 @@ $scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'ye $show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false; $sections = get_option( 'sportspress_player_performance_sections', -1 ); $show_teams = apply_filters( 'sportspress_player_team_statistics', true ); -$leagues = get_the_terms( $id, 'sp_league' ); +$leagues = array_filter( ( array ) get_the_terms( $id, 'sp_league' ) ); // Sort Leagues by User Defined Order (PHP5.2 supported) foreach ( $leagues as $key => $league ) {