diff --git a/templates/player-statistics.php b/templates/player-statistics.php index 6be98d9b..60469089 100644 --- a/templates/player-statistics.php +++ b/templates/player-statistics.php @@ -16,7 +16,6 @@ if ( ! isset( $id ) ) $player = new SP_Player( $id ); $scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false; -$show_total = get_option( 'sportspress_player_show_total', 'no' ) == 'yes' ? true : false; $leagues = get_the_terms( $id, 'sp_league' ); // Loop through statistics for each league @@ -69,53 +68,51 @@ if ( is_array( $leagues ) ): endforeach; endif; -if ( $show_total ): - $data = $player->data( 0 ); +// Career total +$data = $player->data( 0 ); - // The first row should be column labels - $labels = $data[0]; +// The first row should be column labels +$labels = $data[0]; - // Remove the first row to leave us with the actual data - unset( $data[0] ); +// Remove the first row to leave us with the actual data +unset( $data[0] ); - // Skip if there are no rows in the table - if ( empty( $data ) ) - return false; +// Skip if there are no rows in the table +if ( empty( $data ) ) + return false; - $output = '
| ' . $label . ' | '; +endforeach; + +$output .= '|
|---|---|
| ' . $label . ' | '; + $output .= '' . sp_array_value( $row, $key, '—' ) . ' | '; endforeach; - $output .= '
| ' . sp_array_value( $row, $key, '—' ) . ' | '; - endforeach; - - $output .= '