Action Hooks
Action hooks available in SportsPress. These hooks use WordPress's do_action() function and are confirmed present in the plugin source.
Variable placeholders used throughout:
(post_type)—event,calendar,team,table,player,list,staff,directory,sponsor(tab)—general,events,teams,players,staff,branding,league-menu,sponsors,text,configure(option_type)—checkbox,textarea,text,email,number,select,color,password,radio,multiselect
Lifecycle Actions
Actions triggered during plugin initialization and page load:
Hook | When It Fires |
| After the Pro plugin bootstraps (Pro only) |
| Before localization, formats, and string options are loaded |
| After SportsPress core initializes |
| After the core features have been loaded |
| After core widgets are registered |
| Before core taxonomies are registered |
| After core taxonomies are registered |
| Before core post types are registered |
| After core post types are registered |
| After the plugin is updated to a new version |
Admin Actions
Actions triggered in the WordPress admin:
Hook | When It Fires |
| After enqueuing admin styles |
| After admin post type handler classes are loaded |
Settings Actions
Actions executed on SportsPress settings pages:
Hook | When It Fires |
| Before settings are displayed |
| While saving a specific settings tab |
| After saving a specific settings tab |
| After any tab is saved |
| After settings are saved (fires once per save) |
| While displaying a specific settings tab |
| After the main content of a settings tab section |
| After a settings tab section is fully rendered |
| While displaying an input field of a given type |
| While updating an option of a given type |
| While updating any option |
Template Actions
Actions triggered during frontend template loading:
Hook | When It Fires |
| Before a template file is loaded (current) |
| After a template file is loaded (current) |
| Before a template is loaded (deprecated alias) |
| After a template is loaded (deprecated alias) |
| Before the post type content is displayed |
| While outputting the post type content |
| After the post type content is loaded |
Shortcode / AJAX Actions
Actions triggered in the shortcode builder interface:
Hook | When It Fires |
| When rendering a shortcode form in the editor modal |
| Before shortcode scripts are output in AJAX context |
Welcome Page Actions
Hook | When It Fires |
| Before welcome page feature list is rendered |
| After welcome page feature list is rendered |
Modules Actions
Hook | When It Fires |
| Inside the modules page sidebar area |
| After the modules page sidebar area |
Usage Example
// Run code after SportsPress core has fully loaded
add_action( 'sportspress_loaded', function() {
// Your code here
});// Add custom content after a player profile
add_action( 'sportspress_after_single_player', function() {
echo '<p>Custom content below player profile.</p>';
});// Run code after saving the Events settings tab
add_action( 'sportspress_update_options_events', function() {
// React to events settings being saved
});
