Avoid nullifying the stats array if Player Statistic template not enabled

This commit is contained in:
savvasha
2020-08-11 08:47:57 +03:00
committed by GitHub
parent 75d4469b21
commit 0dac5c28b4

View File

@@ -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] );
}