Hooks reference
Every action and filter the plugins provide, with their arguments. Filters unless marked (action).
Lifecycle
| Hook | Arguments | Use |
|---|---|---|
siteryn_ssm_loaded (action) | $plugin | Free booted with its requirements met |
siteryn_ssm_upgrade (action) | $installed_version, $current_version | On init when the stored version differs |
siteryn_ssm_activated · siteryn_ssm_deactivated (action) | - | Plugin activation and deactivation |
siteryn_ssm_subscription_created (action) | $subscription, $order | A paid order created a subscription |
siteryn_ssm_subscription_status_changed (action) | $subscription, $from, $to | After a status change was saved |
siteryn_ssm_renewal_order_created (action) | $order, $subscription | A renewal order was created and the subscription put on hold; a gateway with automatic payments charges it here |
siteryn_ssm_renewal_payment_complete (action) | $subscription, $order | A paid renewal was applied |
siteryn_ssm_processed_subscriptions (action) | $result | After each hourly run (renewed, cancelled, expired counts) |
Subscriptions and renewals
| Hook | Arguments | Use |
|---|---|---|
siteryn_ssm_subscription_statuses | $statuses | Status key => label; keys lowercase, at most 16 characters; Free's statuses can't be removed |
siteryn_ssm_can_transition_status | $allowed, $from, $to | Allow or block a status change |
siteryn_ssm_supported_product_types | $types | Product types that can be subscriptions (default simple) |
siteryn_ssm_renewal_order | $order, $subscription | Change a renewal order before its totals are calculated and it is saved |
siteryn_ssm_cancelling_order_statuses | $statuses, $order | Order statuses that cancel the subscription (default cancelled, refunded) |
siteryn_ssm_batch_size | $size | Subscriptions per step of the hourly run (1–100, default 25) |
My Account and display
| Hook | Arguments | Use |
|---|---|---|
siteryn_ssm_account_subscriptions | $subscriptions, $customer_id, $page | The subscriptions on the current list page |
siteryn_ssm_user_can_view_subscription | $can, $subscription, $user_id | Who may view a subscription (default: its customer) |
siteryn_ssm_subscription_actions | $actions, $subscription, $context | Customer buttons, each array( 'url', 'label', 'primary'? ); $context list or view |
siteryn_ssm_subscription_detail_rows | $rows, $subscription | Detail rows on a subscription's page, array( 'label', 'html' ) with escaped HTML |
siteryn_ssm_subscription_number | $number, $subscription | The number shown to customers (default #123) |
siteryn_ssm_subscription_view_url | $url, $subscription | A subscription's My Account URL |
siteryn_ssm_reserved_slugs | $reserved | Slugs the My Account address may not use |
siteryn_ssm_load_assets | $needed | Whether the storefront stylesheet loads |
siteryn_ssm_inline_css | $css, $settings | Inline status color CSS |
siteryn_ssm_before_account_subscriptions · siteryn_ssm_after_account_subscriptions (action) | $subscriptions | Around the My Account list |
siteryn_ssm_before_subscription_details · siteryn_ssm_after_subscription_details (action) | $subscription | Around a subscription's page (Pro prints its confirmation panels here) |
siteryn_ssm_locate_template | $template, $template_name | The final template path |
siteryn_ssm_before_template · siteryn_ssm_after_template (action) | $template_name, $args | Around every template |
siteryn_ssm_order_meta_box_after (action) | $subscription, $order | After each subscription in the admin order screen's Subscriptions box |
Settings screen
| Hook | Arguments | Use |
|---|---|---|
siteryn_ssm_settings_get_all | $settings | Resolved Free settings for this request |
siteryn_ssm_settings_sections | $sections | Tabs: key => label, option_group?, option_name?, render_callback?, has_save_button? |
siteryn_ssm_settings_fields | $fields | Field schema |
siteryn_ssm_settings_reset_actions | $actions | Option name => admin-post reset action |
siteryn_ssm_settings_save_redirect | $redirect, $option_name | Block a save and send the admin to another tab |
siteryn_ssm_settings_preview_sections | $sections | Tabs with the Live Preview (default display) |
siteryn_ssm_settings_nav_groups | $groups | Left menu groups (settings, pro, system) |
siteryn_ssm_settings_nav_group · siteryn_ssm_settings_nav_visible · siteryn_ssm_settings_nav_badge · siteryn_ssm_settings_nav_icon · siteryn_ssm_settings_nav_sublabel · siteryn_ssm_settings_description | $value, $section | Group, visibility, badge, Dashicon, sublabel and description of a tab |
siteryn_ssm_settings_reset (action) | $section | After Free settings were reset ('' for all) |
siteryn_ssm_settings_panel_top (action) | $section, $active_section | Top of every tab panel |
siteryn_ssm_settings_main_after (action) | $section | After a tab's form |
siteryn_ssm_settings_sidebar (action) | $section | General tab sidebar (Pro adds the dashboard card) |
siteryn_ssm_system_status_cards | $cards | System Status cards while Pro is active |
siteryn_dashboard_plugins | $plugins | Plugin cards on the shared Siteryn Welcome page |
siteryn_deactivation_feedback_endpoint | $url | Where deactivation survey answers are posted (shared by Siteryn plugins) |
Pro
| Hook | Arguments | Use |
|---|---|---|
siteryn_ssm_pro_loaded (action) | $plugin | Pro is running (licensed or not) |
siteryn_ssm_pro_upgrade (action) | $installed, $current | Pro version changed |
siteryn_ssm_pro_deactivate (action) | - | Pro is being deactivated (Paused subscriptions return to Active) |
siteryn_ssm_pro_license_activated (action) | $outcome | After an activation attempt |
siteryn_ssm_pro_license_deactivated (action) | $done | After deactivation |
siteryn_ssm_pro_license_active | $active | Whether Pro features are on |
siteryn_ssm_pro_payment_methods | $methods, $subscription | Gateway id => title offered for renewals |
siteryn_ssm_pro_payment_method_changed (action) | $subscription, $old, $method | A customer chose a new renewal payment method (gateway ids) |
siteryn_ssm_pro_switch_options | $options, $subscription | Product id => product a subscription may switch to |
siteryn_ssm_pro_plan_switched (action) | $subscription, $old_id, $new_id | After a plan switch (product ids) |
siteryn_ssm_pro_recurring_action (action) | $subscription, $action | After renew_now, skip_next or resend_invoice |
siteryn_ssm_pro_processed (action) | $result | After Pro's hourly work (resumed, cancelled, reminded) |
siteryn_ssm_pro_send_status_email (action) | $subscription, $from, $to | Triggers the status and cancellation emails |
siteryn_ssm_pro_send_renewal_reminder (action) | $subscription | Triggers the renewal reminder email |
siteryn_ssm_pro_detail_row_catalog | $rows | Details listed in the Details Builder (key => label) |
siteryn_ssm_pro_settings_fields | $fields | Pro field schema |
siteryn_ssm_pro_settings_get_all | $settings | Resolved Pro settings |
Example
// Add a "Delivery day" row to every subscription page.
add_filter( 'siteryn_ssm_subscription_detail_rows', function ( $rows, $subscription ) {
$rows['delivery'] = array(
'label' => __( 'Delivery day', 'my-theme' ),
'html' => esc_html__( 'First Monday of the month', 'my-theme' ),
);
return $rows;
}, 10, 2 );