Display player stats category once each

This commit is contained in:
Brian Miyaji
2016-04-01 12:51:56 +11:00
parent fdb780aa28
commit 7499fe0503

View File

@@ -38,13 +38,15 @@ if ( is_array( $leagues ) ):
foreach ( $section_order as $section_id => $section_label ) { foreach ( $section_order as $section_id => $section_label ) {
if ( -1 !== $section_id && ! in_array( $section_id, $player_sections ) ) continue; if ( -1 !== $section_id && ! in_array( $section_id, $player_sections ) ) continue;
if ( sizeof( $leagues ) > 1 ) {
printf( '<h3 class="sp-post-caption sp-player-statistics-section">%s</h3>', $section_label );
}
foreach ( $leagues as $league ): foreach ( $leagues as $league ):
$caption = $league->name; $caption = $league->name;
if ( null !== $section_label ) { if ( null !== $section_label ) {
if ( sizeof( $leagues ) > 1 ) { if ( sizeof( $leagues ) === 1 ) {
printf( '<h3 class="sp-post-caption sp-player-statistics-section">%s</h3>', $section_label );
} else {
$caption = $section_label; $caption = $section_label;
} }
} }