WordPress plugin intelligence profile

Advanced H2H for SportsPress

Give your league managers the option to use more advanced Sorting Criteria for your League Tables.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 7.1
Current version2.2.0
WordPress coverageTested up to WordPress 7.1
Minimum stackWP 5.3 · PHP 7.4
Directory statusactive
Last directory update2 Oct 20261mo ago
Active installations200Adoption metric — not a quality score
WordPress.org rating5.0 / 5 from 4 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Advanced H2H for SportsPress version 2.2.0 as active, updated 1mo ago and tested up to WordPress 7.1.

Overview

About this plugin

This plugin is an extension for SportsPress.

Give your league managers the option to use more advanced Sorting Criteria for your League Tables.

Now is possible to select different Sorting Criteria for each League Table!

How to Use

Step 1: Create Sorting Criteria

  • Go to SportsPress -> Teams -> Sorting Criteria in your WordPress admin.
  • Click “Add New Criterion”.
  • Give your criterion a descriptive name (e.g., “Premier League Style”, “Champions League Rules”).

Step 2: Configure Regular Order

In the “Regular Order” section:

  • Drag and drop the columns in the order you want them to be considered for initial sorting.
  • Toggle the switch to disable criteria you do not want.
  • Set sort direction (Ascending/Descending) for each column.

This determines the primary sorting order when teams have different points.

Important: The Tiebreak Order is only applied between teams that are equal on every column enabled in the Regular Order. If you want the head-to-head rules to decide between teams that are level on points, keep Points as the only column in the Regular Order and move everything else (including overall Goal Difference and Goals For) to the Tiebreak Order.

If you leave Goal Difference in the Regular Order, teams that are level on points but have a different Goal Difference are separated before the head-to-head rules can be applied.

Step 3: Configure Tiebreak Order

In the “Tiebreak Order” section:

  • Drag and drop columns in the order they should be used for tiebreakers.
  • Toggle the switch to disable criteria you do not want.
  • Set sort direction for each column.
  • Enable the “H2H Only” checkbox for columns that should only consider head-to-head results (matches played between the tied teams). Leave it unchecked for a column that should use full-season stats.

This determines how teams are ranked when they are equal on the Regular Order (for example, when they have the same points).

Step 4: Review the Summary

The “Sorting Criteria Summary” sidebar shows:

  • Your configured regular order.
  • Your configured tiebreak order.
  • A clear overview of your sorting rules.

Step 5: Apply to League Tables

  • Go to SportsPress -> Tables.
  • Edit an existing league table or create a new one.
  • In the sidebar, find the “Advanced Sorting Criteria” meta box.
  • Select your custom sorting criterion from the dropdown.
  • Save the league table.

Examples

Premier League Style (overall Goal Difference decides before head-to-head):

  • Regular Order: Points (DESC), Goal Difference (DESC), Goals For (DESC)
  • Tiebreak Order: Points (DESC), Goal Difference (DESC), Goals For (DESC), Goals Away (DESC)

Champions League Style (head-to-head decides before overall Goal Difference):

  • Regular Order: Points (DESC)
  • Tiebreak Order: Points [H2H Only] (DESC), Goal Difference [H2H Only] (DESC), Goals For [H2H Only] (DESC), Goal Difference (DESC), Goals For (DESC)

Note: for the Champions League style, Points must be the only column in the Regular Order. Overall Goal Difference and Goals For go in the Tiebreak Order (with “H2H Only” unchecked) so they are only used after the head-to-head criteria. Putting Goal Difference in the Regular Order would separate teams that are level on points before the head-to-head rules are applied.

Developer Hooks

) without editing the template. Defaults produce exactly the same markup as before, so existing sites are unaffected until you hook in.

, 'sp_team' ) returns strings. g. in_array( (int) $team_id, array_map( 'intval', $teams ), true ).

sah2h_league_table_rows — ( array $data, int $table_id )

Change the row data just before the loop (reorder, add or remove rows). Keys are team post IDs.

g. custom re-ordering }, 10, 2 );

sah2h_league_table_row_attributes — ( array $attr, int $team_id, array $row, int $table_id )

Add any attribute to the <tr>. $attr['class'] is an array of CSS classes.

add_filter( 'sah2h_league_table_row_attributes', function ( $attr, $team_id, $row, $table_id ) { $attr['class'][] = 'highlighted'; // colours the whole row $attr['data-team'] = $team_id; // custom data-* hook for JS return $attr; }, 10, 4 );

sah2h_league_table_cell_attributes — ( array $attr, string $column, int $team_id, array $row, int $table_id )

Add attributes to an individual <td>. g. 'pts' ).

$attr['class'] is an array; $attr['data-label'] is the responsive label.

add_filter( 'sah2h_league_table_cell_attributes', function ( $attr, $column, $team_id, $row, $table_id ) { if ( 'name' === $column ) { $attr['class'][] = 'sp-highlight'; } return $attr; }, 10, 5 );

sah2h_league_table_row_html — ( string $html, int $team_id, array $row, int $table_id )

</tr> markup for a single row.

g. append a sub-row or wrap the markup }, 10, 4 );

sah2h_league_table_html — ( string $output, int $table_id )

Catch-all filter on the complete table markup before it is echoed.

add_filter( 'sah2h_league_table_html', function ( $output, $table_id ) { return $output. '<p class="legend">Bold = teams in this match</p>'; }, 10, 2 );

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • head to head
  • h2h
  • sort
  • sorting
  • table
Compatibility & maintenance

Compatibility & maintenance

Tested with WP 7.1

Marked as tested with the current WordPress 7.1 release.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to7.1
Minimum requirementsWordPress 5.3 · PHP 7.4
Update activity2 Oct 20261mo ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

Version2.1.32.2.0
WordPress compatibility7.17.1.2
Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.