Avoid nullifying the stats array if Player Statistic template not enabled
This commit is contained in:
@@ -802,13 +802,9 @@ class SP_Player extends SP_Custom_Post {
|
|||||||
|
|
||||||
$labels = array();
|
$labels = array();
|
||||||
|
|
||||||
if ( 'no' === get_option( 'sportspress_player_show_statistics', 'yes' ) ) {
|
$labels['name'] = __( 'Season', 'sportspress' );
|
||||||
$merged = array();
|
$labels['team'] = __( 'Team', 'sportspress' );
|
||||||
} else {
|
|
||||||
$labels['name'] = __( 'Season', 'sportspress' );
|
|
||||||
$labels['team'] = __( 'Team', 'sportspress' );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( 'no' === get_option( 'sportspress_player_show_total', 'no' ) ) {
|
if ( 'no' === get_option( 'sportspress_player_show_total', 'no' ) ) {
|
||||||
unset( $merged[-1] );
|
unset( $merged[-1] );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user