Skip to content

Developer reference

For anyone putting the plugin on a page, extending it from another plugin, or driving it from a shell. Everything here is public surface — the shortcodes, hooks and commands the plugin means for you to use — as opposed to its internals, which move without warning.

  • Shortcodes


    The core plugin's public forms and account page, plus English FA's and Card Payment's, with every attribute they accept.

  • Hooks and filters


    Adding to the Squads screen, reacting to a confirmed registration or a GoCardless event, the settings that are filterable rather than configurable, and the scheduled jobs.

  • WP-CLI commands


    wp cpm squad for scripted squad setup, and wp cpm generate and wp ccp generate for demo data on a staging site.

  • Admin UI conventions


    The rules every admin screen in the family follows. Required reading before writing a template that has to look like it belongs.

  • The platform layer


    What the core plugin offers a companion plugin, how to depend on it safely, and the version contract between them.

Two things worth knowing first

The cpm_ prefix is the whole namespace. Hooks, capabilities, tables, options and CSS classes all carry it. A hook without it is not this plugin's. The companion plugins have prefixes of their own: efa_ (English FA), crf_ (Referees) and ccp_ (Card Payment).

Two capabilities gate everything. cpm_access means "can reach the plugin at all" — a team secretary has it. cpm_manage_all means "club admin". Check those rather than manage_options if you are adding a screen that should follow the plugin's own access rules, and note the one deliberate exception: Club Mailer's settings screen stays on manage_options, because it stores OAuth client secrets capable of sending mail as any user who has connected a mailbox.