From 0dac5c28b467de41daafc214844daf467e3a19f7 Mon Sep 17 00:00:00 2001 From: savvasha Date: Tue, 11 Aug 2020 08:47:57 +0300 Subject: [PATCH] Avoid nullifying the stats array if Player Statistic template not enabled --- includes/class-sp-player.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php index 66534334..c16d5888 100644 --- a/includes/class-sp-player.php +++ b/includes/class-sp-player.php @@ -802,13 +802,9 @@ class SP_Player extends SP_Custom_Post { $labels = array(); - if ( 'no' === get_option( 'sportspress_player_show_statistics', 'yes' ) ) { - $merged = array(); - } else { - $labels['name'] = __( 'Season', 'sportspress' ); - $labels['team'] = __( 'Team', 'sportspress' ); - } - + $labels['name'] = __( 'Season', 'sportspress' ); + $labels['team'] = __( 'Team', 'sportspress' ); + if ( 'no' === get_option( 'sportspress_player_show_total', 'no' ) ) { unset( $merged[-1] ); }