Display players who are at risk of suspension due to accumulated yellow cards. Shows players who are one card away from a ban. Perfect for match previews, team news sections, or squad management pages.
Premium Feature
This shortcode requires the Football Leagues Premium plugin.
Basic Usage
[anwpfl-suspension-risk competition_id="12"]
This displays all players in competition 12 who are one yellow card away from suspension.
All Parameters
| Parameter | Default | Description |
|---|---|---|
competition_id * |
(empty) | Competition ID to check. Required unless game_id is set. |
club_id |
(all) | Filter to specific club |
game_id |
(empty) | A single game ID. Shows only the at-risk players of the two clubs in that game. |
header |
(empty) | Custom header text |
show_links |
0 | Link player names. Use 1 to enable |
show_photos |
1 | Show player photos. Use 0 to hide |
show_teams |
1 | Show team column. Use 0 to hide |
* Required unless game_id is set.
Examples
Example 1: Competition-Wide Risk List
When to use: Show all at-risk players in the league.
[anwpfl-suspension-risk competition_id="12" header="Players Walking a Tightrope"]
Result: All players one card away from suspension, with header.
Example 2: Club-Specific Risk
When to use: Club page showing their at-risk players.
[anwpfl-suspension-risk competition_id="12" club_id="8" show_teams="0"]
Result: Only club 8’s at-risk players (team column hidden since obvious).
Example 3: Match Preview
When to use: Pre-match page showing both teams’ risk players.
[anwpfl-suspension-risk game_id="501" header="Players at Risk This Match"]
Result: At-risk players from both teams in game 501. The competition is read from the game itself, so you don’t need to pass competition_id as well – if you do, it’s overwritten. Cards picked up in game 501 are not counted, which is what you want for a preview.
Example 4: Minimal Display
When to use: Compact sidebar widget.
[anwpfl-suspension-risk competition_id="12" show_photos="0" show_links="1"]
Result: Text-only list with clickable player names.
Important
Suspension thresholds are not a plugin setting. They live in a Card Suspensions record attached to the competition, at Competitions > Card Suspensions. Without such a record the shortcode outputs nothing. See Card Suspension for how to create one.
How It Works
The shortcode automatically calculates:
- Current yellow card count per player, across finished games in the competition
- The yellow-card thresholds from the competition’s Card Suspensions record
- Players sitting on exactly one card below a threshold are shown as “at risk”. A player who is two or more cards short isn’t listed, and neither is one already at the threshold.
Two details worth knowing. When nobody is at risk the shortcode prints nothing at all – no heading, no empty box – so a blank spot on the page is the normal result, not a bug. And a player sent off for two yellows in one game has that game’s yellows dropped from the count entirely, because the ban for it has already been served.
Troubleshooting
No players showing?
- No players may be at risk currently
- Verify card data is entered in match events
- Check that a Card Suspensions record exists for this competition, and that it has at least one yellow-card rule with Number of Cards of 2 or more and Games to suspend filled in
Related
[anwpfl-missing-players]– Full missing/cards tracking[anwpfl-cards]– Card rankings (Core)- Card Suspension – Set the thresholds this shortcode reads
