From 5bf13f1929b89bfd7ec96da2159dee6a53981c01 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 28 Mar 2017 09:31:27 +1100 Subject: [PATCH] Fix notice when no sendoffs recorded --- includes/class-sp-player-list.php | 2 +- includes/class-sp-player.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-sp-player-list.php b/includes/class-sp-player-list.php index 4b05a74c..f7ba980d 100644 --- a/includes/class-sp-player-list.php +++ b/includes/class-sp-player-list.php @@ -418,7 +418,7 @@ class SP_Player_List extends SP_Custom_Post { if ( empty( $timeline_performance ) ) continue; foreach ( $sendoffs as $sendoff_key ): if ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) continue; - $sendoff_times = sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), $sendoff_key ); + $sendoff_times = (array) sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), $sendoff_key, array() ); $sendoff_times = array_filter( $sendoff_times ); $sendoff_time = end( $sendoff_times ); if ( ! $sendoff_time ) $sendoff_time = 0; diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php index 4df27d0d..fc99a42e 100644 --- a/includes/class-sp-player.php +++ b/includes/class-sp-player.php @@ -407,7 +407,7 @@ class SP_Player extends SP_Custom_Post { if ( empty( $timeline_performance ) ) continue; foreach ( $sendoffs as $sendoff_key ): if ( ! array_key_exists( $sendoff_key, $timeline_performance ) ) continue; - $sendoff_times = sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), $sendoff_key ); + $sendoff_times = (array) sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), $sendoff_key, array() ); $sendoff_times = array_filter( $sendoff_times ); $sendoff_time = end( $sendoff_times ); if ( false === $sendoff_time ) continue;