From 7499fe05037615d7d0ae1bb5e7d09b3d17cef10d Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Fri, 1 Apr 2016 12:51:56 +1100 Subject: [PATCH] Display player stats category once each --- templates/player-statistics.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/player-statistics.php b/templates/player-statistics.php index d48f0e1b..837a472d 100644 --- a/templates/player-statistics.php +++ b/templates/player-statistics.php @@ -38,13 +38,15 @@ if ( is_array( $leagues ) ): foreach ( $section_order as $section_id => $section_label ) { if ( -1 !== $section_id && ! in_array( $section_id, $player_sections ) ) continue; + if ( sizeof( $leagues ) > 1 ) { + printf( '

%s

', $section_label ); + } + foreach ( $leagues as $league ): $caption = $league->name; if ( null !== $section_label ) { - if ( sizeof( $leagues ) > 1 ) { - printf( '

%s

', $section_label ); - } else { + if ( sizeof( $leagues ) === 1 ) { $caption = $section_label; } }