Display default caption for combined player stats

This commit is contained in:
Brian Miyaji
2016-03-31 12:31:32 +11:00
parent 46b579bded
commit 8029293d30

View File

@@ -39,14 +39,16 @@ if ( is_array( $leagues ) ):
if ( -1 !== $section_id && ! in_array( $section_id, $player_sections ) ) continue; if ( -1 !== $section_id && ! in_array( $section_id, $player_sections ) ) continue;
foreach ( $leagues as $league ): foreach ( $leagues as $league ):
$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 ); printf( '<h3 class="sp-post-caption sp-player-statistics-section">%s</h3>', $section_label );
$caption = $league->name;
} else { } else {
$caption = $section_label; $caption = $section_label;
} }
} }
sp_get_template( 'player-statistics-league.php', array( sp_get_template( 'player-statistics-league.php', array(
'data' => $player->data( $league->term_id, false, $section_id ), 'data' => $player->data( $league->term_id, false, $section_id ),
'league' => $league, 'league' => $league,