Cricket Sport Features
Beyond terminology, the Cricket plugin adds four cricket-specific behaviours: extras tracking, separate DNB display, score-status output, and customisable result formatting.
Extras row
Cricket scorecards traditionally include an "Extras" row totalling byes, leg byes, wides, and no-balls. The plugin adds:
A row to the performance table footer via
sportspress_event_performance_meta_box_table_footer(priority 10) on the admin sideA matching row on the frontend via
sportspress_event_performance_table_footer(priority 10)Extras values are added to team totals via
sportspress_event_performance_table_total_value(priority 10)Forces the footer to be visible via
sportspress_event_performance_show_footer(returns true)
Did Not Bat (DNB) display
Cricket convention lists batters who did not bat as part of the squad but separately from the active line-up. The plugin renders the DNB list after the main performance table via sportspress_after_event_performance_table. The substitute terminology is also remapped — see Terminology.
Score-status output
Cricket match results are typically expressed as "won by X runs" or "won by X wickets". The plugin adds output for this status via sportspress_after_event_logos and gates it behind the Show score status event-logo option.
To enable:
Go to SportsPress → Settings → Events.
Tick Show score status.
Save.
Customisable result formatting
The plugin filters several result-display hooks to allow cricket-specific formatting:
sportspress_event_logos_team_resultsportspress_event_team_result_adminsportspress_calendar_team_result_adminsportspress_event_list_main_resultssportspress_event_blocks_team_result_or_timesportspress_main_results_or_timesportspress_main_results
Two settings control the formatting:
Setting | Effect |
Results delimiter | The character used between team scores (default: |
Reverse results format | When ticked, displays results with the away team's score first |
Both settings live alongside Show score status in the event-logo options.
Frontend assets
js/sportspress-cricket.js— Provides cricket-specific frontend behaviourcss/sportspress-for-cricket.css— Styles the extras row and DNB list
Admin assets (css/admin.css, js/admin.js) are loaded only on sp_event and edit-sp_event screens to keep admin pages otherwise unaffected.
