Skip to main content

Career Totals

Career totals summarize a player's statistics across all seasons and leagues into a single row.

Updated today

Career Totals

Career totals summarize a player's statistics across all seasons and leagues into a single row.

What Career Totals Show

The career total is calculated by summing all per-season values for each statistic. It is labelled Total internally (the name key in the merged data array is 'Total'; the team key shows '-').

For statistics whose type is Average rather than Total, the career total is re-calculated using the statistic's equation rather than simply summed, so averages remain meaningful across seasons.

The Two "Total" Rows

There are two distinct total concepts in the Statistics meta box:

  1. Season Total row — the footer row inside each per-league table. It shows the sum of all seasons within that league. This row is always displayed in the admin meta box. Toggling the Total display option in Player Settings controls whether this row shows on the frontend.

  1. Career Total section — appears below all per-league tables when enabled. It adds statistics across all leagues the player belongs to. Enabling the Career Total display option in Player Settings controls whether this appears on both the admin and the frontend.

Enabling Career Totals

  1. Go to SportsPress > Settings > Players.

  2. Under the Statistics section, locate Display.

  3. Check Career Total.

  4. Save settings.

The option key is sportspress_player_show_career_total. Default value is no.

Enabling the Season Total Row on the Frontend

In the same Display checkbox group, check Total to show the per-league season total row on player profile pages. The option key is sportspress_player_show_total. Default value is no.

Manual Override of Career Totals

The career total can be overridden by entering values directly into the career total table row in the Statistics meta box on the player edit screen. Manual values are stored in sp_statistics under league ID 0, season ID 0. When a manual value is present it takes precedence over the auto-calculated total for that column.

How the Calculation Works

The SP_Player::data() method:

  1. Loops through all seasons the player is assigned to.

  2. For each season, queries all competitive events where the player appears in sp_players meta.

  3. Sums performance values into $totals.

  4. Applies statistic equations to produce per-season values in $placeholders.

  5. Builds $merged — the per-season rows.

  6. After all seasons are processed, loops through $merged and accumulates a $career array.

  7. For total-type statistics, adds all season values together.

  8. For average-type statistics, re-solves the equation using the accumulated totals.

  9. Merges any manually entered career data on top of the calculated values.

  10. Stores the result at $merged[-1].

The career row is keyed as -1 in the $merged array internally.

Did this answer your question?