Hooks reference

Every action and filter the plugins provide, with their arguments and examples you can copy.

FreePro

Lifecycle

ActionArgumentsFires
siteryn_donations_loaded$pluginOnce per request, after requirements are met and every service is hooked
siteryn_donations_upgrade$from, $toOnce, when the stored version differs from the running one
siteryn_donations_activated · siteryn_donations_deactivatedAfter activation / on deactivation

Donation products and the Donate page

FilterArgumentsUse
siteryn_donations_is_donation_product$is_donation, $productTreat other products as donation products
siteryn_donations_enabled$enabledMaster switch (Enable donations)
siteryn_donations_default_product_id$product_idThe product the box and shortcode add to
siteryn_donations_default_product$productThe automatic product before it is first saved
siteryn_donations_create_donation_page$createReturn false to skip creating the Donate page
siteryn_donations_donation_page_args$argswp_insert_post() arguments of the Donate page
siteryn_donations_price_html$html, $productThe "From $5" price

Amounts

$context is where the amount is chosen: product, cart, checkout, cart_block, checkout_block or shortcode (preview in the admin).

FilterArgumentsUse
siteryn_donations_amount_options$amounts, $context, $productFixed amounts (ascending, max 12)
siteryn_donations_allow_custom_amount$allowed, $context, $productAccept a custom amount
siteryn_donations_amount_limits$limits, $context, $productarray( 'min' => float, 'max' => float|null )
siteryn_donations_default_amount$amount, $context, $productPre-selected amount (must be a fixed amount)
siteryn_donations_validate_amount$result, $raw, $context, $productFinal say; return a WP_Error with a shopper-facing message to reject
add_filter( 'siteryn_donations_amount_options', function ( $amounts, $context ) {
	return 'shortcode' === $context ? array( 25, 50, 100, 250 ) : $amounts;
}, 10, 2 );

Cart and orders

HookArgumentsUse
siteryn_donations_cart_item_data (filter)$donation, $product_id, $extraAdd your own keys to the stored donation; $extra holds the siteryn_donations_extra[...] inputs
siteryn_donations_added_to_cart (action)$key, $amount, $product, $contextAfter a donation is added
siteryn_donations_removed_from_cart (action)$key, $product_idAfter a donation line is removed (also when a new amount replaces it)
siteryn_donations_create_order_line_item (action)$item, $donation, $orderA donation was recorded on a new order line (classic and block checkout)
siteryn_donations_order_language (filter)$language, $orderLanguage of an order's customer-facing output
add_action( 'siteryn_donations_added_to_cart', function ( $key, $amount, $product, $context ) {
	error_log( sprintf( 'Donation of %s to %s from %s', $amount, $product->get_name(), $context ) );
}, 10, 4 );

Storefront

HookArgumentsUse
siteryn_donations_widget_should_display (filter)$display, $context, $productShow or hide the box (Pro's display rules use it)
siteryn_donations_widget_args (filter)$args, $context, $productBox template arguments (title, texts, classes…)
siteryn_donations_amount_picker_args (filter)$args, $context, $productAmount picker template arguments
siteryn_donations_amount_picker_allowed_html (filter)$allowedAllowed HTML for the picker inside the box; extend it for a template override
siteryn_donations_after_add_redirect (filter)$url, $contextWhere donors go after adding from the Donate page form; '' to stay
siteryn_donations_widget_before_form (action)$argsInside the box, before the form (Pro's progress bar)
siteryn_donations_widget_before_actions (action)$argsInside the form, before the button (Pro's frequency choice)
siteryn_donations_widget_after_form (action)$argsInside the box, after the form
siteryn_donations_enqueue_assets (filter)$enqueueLoad the CSS and JS on more pages
siteryn_donations_inline_css (filter)$cssThe settings-driven CSS variables
add_filter( 'siteryn_donations_widget_should_display', function ( $display ) {
	return current_user_can( 'wholesale_customer' ) ? false : $display;
} );

Templates

HookArgumentsUse
siteryn_donations_locate_template (filter)$path, $template_nameChange the resolved template file
siteryn_donations_bundled_templates (filter)$templatesRegister your own overridable templates (Pro adds its three)
siteryn_donations_before_template · siteryn_donations_after_template (actions)$template_name, $argsAround every template

Settings and admin

HookArgumentsUse
siteryn_donations_settings_sections$sectionsAdd tabs (label, optional option_group, option_name, render_callback)
siteryn_donations_settings_fields$fieldsAdd fields to a tab
siteryn_donations_settings_reset_actions$actionsoption_name => admin-post action for Reset to Defaults
siteryn_donations_settings_save_redirect$redirect, $option_nameBlock a save and send the admin to another tab
siteryn_donations_settings_nav_groups$groupsLeft-menu groups (overview, settings, system)
siteryn_donations_settings_nav_group$group, $sectionWhich group a tab is listed under
siteryn_donations_settings_nav_parent$parent, $sectionPut a tab under another menu item
siteryn_donations_settings_nav_parent_label$label, $sectionMenu name of a top-level tab
siteryn_donations_settings_nav_family$family, $parentOrder of a menu item's tabs
siteryn_donations_settings_nav_icon · _nav_sublabel · _nav_badge · _description$value, $sectionDashicon, sublabel, badge and description of a tab
siteryn_donations_settings_panel_sidebar_shortcodes$shortcodes, $sectionShortcode cards in a tab's sidebar
siteryn_donations_settings_after_form (action)$sectionAfter a tab's form
siteryn_donations_settings_sidebar_{$section} (action)In one tab's sidebar, above Reset to Defaults
siteryn_donations_render_field_{$type} (action)$field, $value, $name, $idRender your own field type
siteryn_donations_sanitize_field_{$type}$value, $raw, $fieldSanitize your own field type
siteryn_donations_system_status_cards$cardsSystem Status cards (label, value, icon, variant)
siteryn_dashboard_plugins$pluginsShared Siteryn hook: cards on the Welcome page

All of these are filters unless marked as actions.

Pro Pro

HookArgumentsUse
siteryn_donations_pro_loaded (action)$pluginPro booted, licensed or not
siteryn_donations_pro_features_loaded (action)$pluginThe licensed features were registered
siteryn_donations_pro_upgrade (action)$from, $toThe stored Pro version changed
siteryn_donations_pro_activated · siteryn_donations_pro_deactivated (actions)After activation / on deactivation
siteryn_donations_pro_license_activated · siteryn_donations_pro_license_deactivated (actions)$successAfter an activation / deactivation attempt
siteryn_donations_pro_counted_statuses$statusesOrder statuses that count toward campaign totals (default: WooCommerce's paid statuses)
siteryn_donations_pro_order_tallied (action)$order, $current, $previousAn order's contribution changed (product_id => amount)
siteryn_donations_pro_campaign_closed$closed, $campaignWhether a campaign still accepts donations
siteryn_donations_pro_progress_args$args, $campaignProgress bar template arguments
siteryn_donations_pro_product_box_applies$applies, $productWhether the box shows on a product page
siteryn_donations_pro_recurring_intervals$intervalsOffered frequencies (week, month, year => label)
siteryn_donations_pro_recurring_donation_paid (action)$item, $interval, $amount, $orderOnce, when an order with a recurring donation is first paid: the integration point for subscriptions
siteryn_donations_pro_thankyou_message$message, $orderThe thank-you text (plain text)
siteryn_donations_pro_inline_css$cssPro's CSS (progress bar color)
siteryn_donations_pro_dashboard_after_summary (action)$range, $summaryOn the Dashboard, after the period's figures
add_filter( 'siteryn_donations_pro_counted_statuses', function ( $statuses ) {
	$statuses[] = 'on-hold';
	return $statuses;
} );
add_filter( 'siteryn_donations_pro_recurring_intervals', function ( $intervals ) {
	unset( $intervals['week'] );
	return $intervals;
} );

There is deliberately no filter to force the license active.