Stats :: Players (Custom) Shortcode

Pro Feature

Display highly customizable player statistics with selectable columns, advanced sorting, filtering, and optional Tabulator layout for interactive data exploration. Supports custom stat columns defined in your plugin settings.

Premium Feature

This shortcode requires the Football Leagues Premium plugin.

Basic Usage

[anwpfl-stats-players-custom competition_id="12" columns="player_name,club,goals,assists"]

This displays a custom stats table with only the specified columns.

All Parameters

Column Selection

ParameterDefaultDescription
columns *(required)Columns to display (comma-separated)

Available Columns

ColumnDescription
rankingRanking position number
player_namePlayer name
clubPlayer’s club
positionPlaying position
appearanceGames played
startedGames started
minutesMinutes played
cards_allAll cards combined
cards_yYellow cards
cards_rRed cards
goalsGoals scored
goals_penaltyPenalty goals
goals_ownOwn goals
assistsAssists
goals_concededGoals conceded
clean_sheetsClean sheets
{custom_stat_id}Any custom stat defined in settings

Query Parameters

ParameterDefaultDescription
competition_id(empty)Competition ID
season_id(empty)Season ID
league_id(empty)League ID
club_id(empty)Club ID
multistage1Include all stages. Use 0 to disable
type(all)Player type: p (players), g (goalkeepers)
date_from(empty)Start date filter (format: YYYY-MM-DD)
date_to(empty)End date filter (format: YYYY-MM-DD)
limit10Maximum players (0 = all)

Sorting Parameters

ParameterDefaultDescription
sort_column(empty)Primary sort column
sort_orderDESCPrimary sort order: asc or desc
sort_column_2(empty)Secondary sort column
sort_order_2DESCSecondary sort order

Filtering Parameters

ParameterDefaultDescription
filter_column_1(empty)First filter column
filter_column_1_value(empty)Minimum value for filter 1
filter_column_2(empty)Second filter column
filter_column_2_value(empty)Minimum value for filter 2

Display Parameters

ParameterDefaultDescription
layout(table)Layout: empty for regular, tabulator for interactive
links0Link player names. Use 1 to enable
photos0Show player photos. Use 1 to enable
club_columnlogo_abbrClub display: title, logo, abbr, logo_title, logo_abbr
header(empty)Custom header text above table
show_filter0Show Tabulator filters. Use 1 to enable
hide_zeros1Hide zero values. Use 0 to show
hide_empty_columns1Hide columns with no data. Use 0 to show
paging0Enable pagination. Use 1 to enable
rows10Records per page (when pagination enabled)

Advanced Display (v0.16.18+)

ParameterDefaultDescription
full_column_namefullColumn header style: full or short
column_font_size(default)Table font size in pixels
max_column_width(default)Maximum column width in pixels
frozen_columns(empty)Columns to freeze during scroll (comma-separated)

* Required parameter

Examples

Example 1: Goals Per 90 Minutes Leaders

When to use: Advanced efficiency metric.

[anwpfl-stats-players-custom competition_id="12" columns="ranking,player_name,club,goals,minutes" sort_column="goals" filter_column_1="minutes" filter_column_1_value="450" limit="20"]

Result: Top 20 scorers with minimum 450 minutes played.

Example 2: Interactive Tabulator Table

When to use: Let users sort and filter data themselves.

[anwpfl-stats-players-custom competition_id="12" columns="player_name,club,position,appearance,goals,assists,cards_y" layout="tabulator" show_filter="1" limit="0"]

Result: Interactive table with client-side sorting and filtering.

Example 3: Midfielder Performance

When to use: Focus on specific position stats.

[anwpfl-stats-players-custom competition_id="12" columns="ranking,player_name,club,goals,assists,cards_y,minutes" sort_column="assists" sort_order="desc" sort_column_2="goals" photos="1" links="1"]

Result: Sorted by assists, then goals, with player photos.

Example 4: Custom Stats Columns

When to use: Display custom-defined statistics.

[anwpfl-stats-players-custom competition_id="12" columns="player_name,club,shots,shots_on_target,key_passes,dribbles" layout="tabulator"]

Result: Table with custom stat columns (if defined in settings).

Example 5: Club Page with Header

When to use: Club-specific stats with title.

[anwpfl-stats-players-custom competition_id="12" club_id="8" columns="ranking,player_name,position,appearance,goals,assists" header="2024/25 Season Statistics"]

Result: Titled table showing only club 8’s players.

Example 6: Date Range Stats

When to use: Statistics for a specific time period.

[anwpfl-stats-players-custom competition_id="12" columns="ranking,player_name,club,goals,assists" date_from="2024-08-01" date_to="2024-12-31" sort_column="goals"]

Result: Stats from matches played between August 1 and December 31, 2024.

Example 7: Frozen Columns with Pagination

When to use: Wide tables with many columns on mobile.

[anwpfl-stats-players-custom competition_id="12" columns="player_name,club,appearance,goals,assists,cards_y,cards_r,minutes" layout="tabulator" frozen_columns="player_name,club" paging="1" rows="20"]

Result: Player name and club stay visible while scrolling horizontally.

Tip

The Tabulator layout provides client-side sorting (click column headers) and filtering capabilities. For large datasets, it offers a better user experience than the standard table layout.

Troubleshooting

Columns not appearing?

  • Check column names are spelled correctly
  • Verify custom stats are defined in plugin settings
  • Use hide_empty_columns="0" to show columns with no data

Tabulator not working?

  • Ensure JavaScript is loading properly
  • Check for conflicts with other plugins

Related

  • [anwpfl-stats-players] – Standard player statistics table
  • [anwpfl-players] – Top scorers/assists (Core)
  • [anwpfl-player-stats-panel] – Single player statistics