Skip to main content

Midseason Transfers

The Midseason Transfers module allows you to track a player's statistics at two different teams within the same season. This is useful when a player transfers mid-season and you need separate stats rows for each club.

Updated today

Midseason Transfers

The Midseason Transfers module allows you to track a player's statistics at two different teams within the same season. This is useful when a player transfers mid-season and you need separate stats rows for each club.

This feature is part of SportsPress Pro.

How It Works

Without this module, each season has one row in the Statistics meta box, and one team is assigned to that row. With Midseason Transfers active, you can insert additional rows for the same season — each with its own team and a Date from field that marks when the player joined that club.

The module hooks into the player statistics table in the admin to add row-management controls, and filters the event query for each split row so that events are counted only within the correct date range.

Adding a Transfer Row

  1. Open the player edit screen.

  2. Scroll to the Statistics meta box.

  3. Locate the season row you want to split.

  4. Click the Insert row after icon (a plus icon, using the dashicons-plus-alt class) at the right end of that season row.

  5. A new row is inserted below the original, visually distinguished with the sp-row-added CSS class.

  6. In the new row's Season column, a date picker input appears with the placeholder Date from.

  7. Enter the date the player joined their new club (the date from which this row's events should be counted).

  8. Select the new team from the Team dropdown in that row.

  9. Save the player.

The Date From Field

The Date from field is a jQuery UI datepicker input rendered as a read-only text field. It stores the date in YYYY-MM-DD format in sp_statistics[league_id][season_id_decimal][date_from].

Transfer rows use a decimal-valued season ID. For example, if the base season has ID 5, the first transfer row uses a key like 5.1. The module detects these non-integer keys to know which rows are transfer splits.

How Stats Are Filtered by Date

When the plugin calculates statistics for a transfer row, it reads the date_from value of that row and the date_from of the next row (if any) for the same season. It then adds a date_query to the WordPress event query:

  • If both a date_from and a following row's date_from exist: events between those two dates are counted.

  • If only a date_from exists (last row for that season): events from date_from onwards are counted.

  • If only a date_to (the next row's date_from) exists: events before that date are counted.

This means each split row calculates statistics only from events in its own date window.

Deleting a Transfer Row

Click the Delete row icon (an X icon, dashicons-dismiss class) on the transfer row to remove it. This removes the row from the admin UI and clears that split's statistics on save.

Module Activation

The module is controlled by the option sportspress_load_midseason_transfers_module. It defaults to yes. To disable it, set this option to no in the database or via a filter.

Did this answer your question?