diff --git a/templates/player-list.php b/templates/player-list.php
index 46fac369..cac1df21 100644
--- a/templates/player-list.php
+++ b/templates/player-list.php
@@ -138,8 +138,6 @@ foreach ( $groups as $group ):
foreach( $labels as $key => $label ):
if ( $key !== 'number' && ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) )
$thead .= '
'. $label . ' | ';
- if ( preg_match ( "/title=\"(.*?)\"/", $label, $new_label ) )
- $labels[$key] = $label[1];
endforeach;
$thead .= '' . '';
@@ -215,8 +213,13 @@ foreach ( $groups as $group ):
foreach( $labels as $key => $value ):
if ( in_array( $key, array( 'number', 'name', 'team', 'position' ) ) )
continue;
- if ( ! is_array( $columns ) || in_array( $key, $columns ) )
- $tbody .= '' . sp_array_value( $row, $key, '—' ) . ' | ';
+ if ( ! is_array( $columns ) || in_array( $key, $columns ) ) {
+ $label = $labels[$key];
+ if ( preg_match ( "/title=\"(.*?)\"/", $value, $new_label ) ) {
+ $label = $new_label[1];
+ }
+ $tbody .= '' . sp_array_value( $row, $key, '—' ) . ' | ';
+ }
endforeach;
$tbody .= '';