Skip to main content

Action Hooks

Action hooks available in SportsPress. These hooks use WordPress's `do_action()` function and are confirmed present in the plugin source.

Updated today

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

sportspress_pro_loaded

After the Pro plugin bootstraps (Pro only)

before_sportspress_init

Before localization, formats, and string options are loaded

sportspress_init

After SportsPress core initializes

sportspress_loaded

After the core features have been loaded

sportspress_widgets

After core widgets are registered

sportspress_register_taxonomy

Before core taxonomies are registered

sportspress_after_register_taxonomy

After core taxonomies are registered

sportspress_register_post_type

Before core post types are registered

sportspress_after_register_post_type

After core post types are registered

sportspress_updated

After the plugin is updated to a new version

Admin Actions

Actions triggered in the WordPress admin:

Hook

When It Fires

sportspress_admin_css

After enqueuing admin styles

sportspress_include_post_type_handlers

After admin post type handler classes are loaded

Settings Actions

Actions executed on SportsPress settings pages:

Hook

When It Fires

sportspress_settings_start

Before settings are displayed

sportspress_settings_save_(tab)

While saving a specific settings tab

sportspress_update_options_(tab)

After saving a specific settings tab

sportspress_update_options

After any tab is saved

sportspress_settings_saved

After settings are saved (fires once per save)

sportspress_settings_(tab)

While displaying a specific settings tab

sportspress_settings_(tab)_end

After the main content of a settings tab section

sportspress_settings_(tab)_after

After a settings tab section is fully rendered

sportspress_admin_field_(option_type)

While displaying an input field of a given type

sportspress_update_option_(option_type)

While updating an option of a given type

sportspress_update_option

While updating any option

Template Actions

Actions triggered during frontend template loading:

Hook

When It Fires

sportspress_before_template

Before a template file is loaded (current)

sportspress_after_template

After a template file is loaded (current)

sportspress_before_template_part

Before a template is loaded (deprecated alias)

sportspress_after_template_part

After a template is loaded (deprecated alias)

sportspress_before_single_(post_type)

Before the post type content is displayed

sportspress_single_(post_type)_content

While outputting the post type content

sportspress_after_single_(post_type)

After the post type content is loaded

Shortcode / AJAX Actions

Actions triggered in the shortcode builder interface:

Hook

When It Fires

sportspress_ajax_shortcode_form

When rendering a shortcode form in the editor modal

sportspress_ajax_scripts_before_shortcode

Before shortcode scripts are output in AJAX context

Welcome Page Actions

Hook

When It Fires

sportspress_before_welcome_features

Before welcome page feature list is rendered

sportspress_after_welcome_features

After welcome page feature list is rendered

Modules Actions

Hook

When It Fires

sportspress_modules_sidebar

Inside the modules page sidebar area

sportspress_modules_after_sidebar

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
});

Did this answer your question?