Hook Reference
{/* AUTO-GENERATED from ../docs/hooks.md by scripts/sync-dev-docs.mjs — do not edit by hand. */}
Generated 2026-05-19 from 4ea77d0d. Do not edit by hand — run make docs-hooks to regenerate.
Drift check: make docs-hooks-check (also runs in make qa).
Actions (11)
dino_discounts_after_apply_couponsdino_discounts_after_templatedino_discounts_allocator_unexpected_negativedino_discounts_before_apply_couponsdino_discounts_before_templatedino_discounts_cache_flushdino_discounts_cart_discount_summarydino_discounts_discount_applieddino_discounts_first_rule_publisheddino_discounts_rules_saveddino_discounts_settings_saved
Filters (19)
dino_discounts_bug_report_emaildino_discounts_bug_report_urldino_discounts_cache_compat_checkersdino_discounts_caching_pluginsdino_discounts_coupon_labeldino_discounts_discount_payloaddino_discounts_enable_cart_ui_syncdino_discounts_enabled_currenciesdino_discounts_enrich_frontend_payloaddino_discounts_evaluated_discountsdino_discounts_incompatible_pluginsdino_discounts_inline_script_datadino_discounts_locate_templatedino_discounts_migration_stepsdino_discounts_nudge_htmldino_discounts_nudge_rulesdino_discounts_performance_monitordino_discounts_preview_userdino_discounts_strategies
Actions
Section titled “Actions”dino_discounts_after_apply_coupons
Section titled “dino_discounts_after_apply_coupons”- Description: Fires after all virtual coupons have been applied.
- Since: 4.0.0
- File:
includes/Cart/Traits/AppliesDiscount.php:385 - Params:
array $discounts,object $cart - Parameter detail:
$discounts(array) — Array of discount result arrays.$cart(object) — The WooCommerce cart object.
- Example:
add_action( 'dino_discounts_after_apply_coupons', function( $discounts, $cart ) {// ...}, 10, 2 );
dino_discounts_after_template
Section titled “dino_discounts_after_template”- Description: Fires after a storefront template has been loaded.
- Since: unknown
- File:
includes/Storefront/template-functions.php:90 - Params:
string $template_name,string $template_path,array $args - Parameter detail:
$template_name(string) — Relative template name.$template_path(string) — Absolute path to the resolved template.$args(array) — Template arguments.
- Example:
add_action( 'dino_discounts_after_template', function( $template_name, $template_path, $args ) {// ...}, 10, 3 );
dino_discounts_allocator_unexpected_negative
Section titled “dino_discounts_allocator_unexpected_negative”- Description: Fires when the per-item allocator emits a negative value larger than the FP-noise band — i.e. something that smells like a real sign-flip or accumulator regression rather than rounding drift. Always paired with a clamp to 0.0 in the return value so the negative never reaches the cart; this hook exists purely for observability.
- Since: 4.16.35
- File:
includes/Engine/Strategy/AbstractStrategy.php:373 - Params:
float $amount - Parameter detail:
$amount(float) — The unexpected negative value the allocator produced.
- Example:
add_action( 'dino_discounts_allocator_unexpected_negative', function( $amount ) {// ...}, 10, 1 );
dino_discounts_before_apply_coupons
Section titled “dino_discounts_before_apply_coupons”- Description: Fires before any virtual coupons are applied.
- Since: 4.0.0
- File:
includes/Cart/Traits/AppliesDiscount.php:189 - Params:
array $discounts,object $cart - Parameter detail:
$discounts(array) — Array of discount result arrays from the engine.$cart(object) — The WooCommerce cart object.
- Example:
add_action( 'dino_discounts_before_apply_coupons', function( $discounts, $cart ) {// ...}, 10, 2 );
dino_discounts_before_template
Section titled “dino_discounts_before_template”- Description: Fires before a storefront template is loaded.
- Since: unknown
- File:
includes/Storefront/template-functions.php:74 - Params:
string $template_name,string $template_path,array $args - Parameter detail:
$template_name(string) — Relative template name.$template_path(string) — Absolute path to the resolved template.$args(array) — Template arguments.
- Example:
add_action( 'dino_discounts_before_template', function( $template_name, $template_path, $args ) {// ...}, 10, 3 );
dino_discounts_cache_flush
Section titled “dino_discounts_cache_flush”- Description: Fires after rules or settings are saved so external cache plugins (LiteSpeed, W3TC, WP Super Cache, etc.) can purge stale pages.
- Since: 4.3.0
- Files:
includes/API/AbstractController.php:192includes/StarterData/ResetManager.php:369
- Params: none
- Example:
add_action( 'dino_discounts_cache_flush', function() {// ...}, 10, 0 );
dino_discounts_cart_discount_summary
Section titled “dino_discounts_cart_discount_summary”- Description: No description provided in source.
- Since: unknown
- File:
includes/Cart/Traits/AppliesDiscount.php:401 - Params: 2 argument(s), no
@paramdocblock - Example:
add_action( 'dino_discounts_cart_discount_summary', function( $arg1, $arg2 ) {// ...}, 10, 2 );
dino_discounts_discount_applied
Section titled “dino_discounts_discount_applied”- Description: Fires after a single virtual discount coupon has been applied.
- Since: 4.3.0
- File:
includes/Cart/Traits/AppliesDiscount.php:375 - Params:
string $code,array $data,object $cart - Parameter detail:
$code(string) — The virtual coupon code.$data(array) — The discount data.$cart(object) — The WooCommerce cart object.
- Example:
add_action( 'dino_discounts_discount_applied', function( $code, $data, $cart ) {// ...}, 10, 3 );
dino_discounts_first_rule_published
Section titled “dino_discounts_first_rule_published”- Description: Fires exactly once when a store moves from zero rules to one-or-more.
- Since: 4.8.0
- File:
includes/API/RulesController.php:511 - Params:
array $sanitized_rules - Parameter detail:
$sanitized_rules(array) — The rules that were just saved.
- Example:
add_action( 'dino_discounts_first_rule_published', function( $sanitized_rules ) {// ...}, 10, 1 );
dino_discounts_rules_saved
Section titled “dino_discounts_rules_saved”- Description: Fires after the discount rules have been saved.
- Since: 4.3.0
- Files:
includes/API/RulesController.php:494includes/StarterData/ResetManager.php:150
- Params:
array $sanitized_rules - Parameter detail:
$sanitized_rules(array) — The saved rules, sanitized; array order is the merchant’s admin reorder (the engine’s evaluation order — no priority sort is applied).
- Example:
add_action( 'dino_discounts_rules_saved', function( $sanitized_rules ) {// ...}, 10, 1 );
dino_discounts_settings_saved
Section titled “dino_discounts_settings_saved”- Description: Fires after the global settings have been saved.
- Since: 4.3.0
- File:
includes/API/SettingsController.php:144 - Params:
array $settings - Parameter detail:
$settings(array) — The saved settings, sanitized.
- Example:
add_action( 'dino_discounts_settings_saved', function( $settings ) {// ...}, 10, 1 );
Filters
Section titled “Filters”dino_discounts_bug_report_email
Section titled “dino_discounts_bug_report_email”- Description: Filter the destination email for the bug-report silent fallback. When the Worker is unreachable or not configured,
wp_mail()sends the full report to this address so bug reports still land even if the Worker is down. Default: the Dino Discounts team alias ({@see self::FALLBACK_EMAIL}). The reporter is typically the site admin themselves and the bug is in this plugin, so routing the fallback back toadmin_emailwould file the report into the reporter’s own inbox — never reaching the team that can fix it. - Since: 4.19.0
- File:
includes/API/BugReportController.php:402 - Params:
string $to,string $title,string $body - Parameter detail:
$to(string) — Destination email.$title(string) — Short description supplied by the reporter.$body(string) — Full report body.
- Example:
add_filter( 'dino_discounts_bug_report_email', function( $to, $title, $body ) {return $to;}, 10, 3 );
dino_discounts_bug_report_url
Section titled “dino_discounts_bug_report_url”- Description: Filter the bug-report submission endpoint URL. Return ” to suppress the “Report a bug” UI across the admin.
- Since: 4.17.0
- File:
includes/Support/BugReport.php:68 - Params:
string $url - Parameter detail:
$url(string) — The endpoint URL.
- Example:
add_filter( 'dino_discounts_bug_report_url', function( $url ) {return $url;}, 10, 1 );
dino_discounts_cache_compat_checkers
Section titled “dino_discounts_cache_compat_checkers”- Description: Filter the per-plugin checker registry. Concrete checkers must implement {@see CacheCompatPluginChecker}. Entries that are not instances of the interface are silently dropped — keeps a misconfigured filter from fatalling admin.
- Since: 5.4.0
- File:
includes/Diagnostics/CacheCompatChecker.php:58 - Params:
CacheCompatPluginChecker[] $checkers - Parameter detail:
$checkers(CacheCompatPluginChecker[]) — Default registry.
- Example:
add_filter( 'dino_discounts_cache_compat_checkers', function( $checkers ) {return $checkers;}, 10, 1 );
dino_discounts_caching_plugins
Section titled “dino_discounts_caching_plugins”- Description: Filters the map of caching plugin basenames to display names.
- Since: 4.7.0
- File:
includes/ConflictDetector.php:142 - Params: 1 argument(s), no
@paramdocblock - Example:
add_filter( 'dino_discounts_caching_plugins', function( $arg1 ) {return $arg1;}, 10, 1 );
dino_discounts_coupon_label
Section titled “dino_discounts_coupon_label”- Description: Filter the coupon display label before it is stored.
- Since: 4.0.0
- File:
includes/Cart/Traits/AppliesDiscount.php:287 - Params:
string $label,array $discount,object $cart - Parameter detail:
$label(string) — The sanitized coupon label.$discount(array) — The discount result array.$cart(object) — The WooCommerce cart object.
- Example:
add_filter( 'dino_discounts_coupon_label', function( $label, $discount, $cart ) {return $label;}, 10, 3 );
dino_discounts_discount_payload
Section titled “dino_discounts_discount_payload”- Description: Filter the discount data payload before it is consumed by JS.
- Since: 2.6.0
- File:
includes/Frontend.php:348 - Params:
array $payload - Parameter detail:
$payload(array) — Discount data for the storefront.$discounts(array[]) — Each entry has ‘name’ (string) and ‘amount’ (float).$currency(array) — Currency formatting data (prefix, decimals, etc.).
- Example:
add_filter( 'dino_discounts_discount_payload', function( $payload ) {return $payload;}, 10, 1 );
dino_discounts_enable_cart_ui_sync
Section titled “dino_discounts_enable_cart_ui_sync”- Description: Filter to disable the cart-UI sync layer entirely. Returning
falseskips the enqueue — useful when a third-party theme or plugin’s own cart layer conflicts with our subscriber (Store API middleware, fragment listeners, mini-cart drawer injection, parallel cart-totals refresh). One-line mu-plugin disables surgically: add_filter( ‘dino_discounts_enable_cart_ui_sync’, ‘__return_false’ ); - Since: REFACTOR-CART-UI-SYNC-LAYER
- File:
includes/Frontend.php:436 - Params:
bool $enabled - Parameter detail:
$enabled(bool) — Default true.
- Example:
add_filter( 'dino_discounts_enable_cart_ui_sync', function( $enabled ) {return $enabled;}, 10, 1 );
dino_discounts_enabled_currencies
Section titled “dino_discounts_enabled_currencies”- Description: Filter the list of enabled currency codes for the admin payload. Multi-currency plugins can hook here to add their active currencies. Each entry should be a WooCommerce currency code (e.g. ‘EUR’, ‘USD’).
- Since: 4.3.8
- File:
includes/Admin.php:960 - Params:
string[] $codes - Parameter detail:
$codes(string[]) — Array of enabled currency codes.
- Example:
add_filter( 'dino_discounts_enabled_currencies', function( $codes ) {return $codes;}, 10, 1 );
dino_discounts_enrich_frontend_payload
Section titled “dino_discounts_enrich_frontend_payload”- Description: No description provided in source.
- Since: unknown
- File:
includes/Frontend.php:334 - Params: 1 argument(s), no
@paramdocblock - Example:
add_filter( 'dino_discounts_enrich_frontend_payload', function( $arg1 ) {return $arg1;}, 10, 1 );
dino_discounts_evaluated_discounts
Section titled “dino_discounts_evaluated_discounts”- Description: Filter the final set of applied discounts before they are returned.
- Since: 2.5.0
- File:
includes/Engine/RulesEngine.php:710 - Params:
array $applied_discounts,\WC_Cart $cart,array $context - Parameter detail:
$applied_discounts(array) — Array of discount result arrays.$cart(\WC_Cart) — The WooCommerce cart object.$context(array) — Evaluation context (currency, country, cart_total).
- Example:
add_filter( 'dino_discounts_evaluated_discounts', function( $applied_discounts, $cart, $context ) {return $applied_discounts;}, 10, 3 );
dino_discounts_incompatible_plugins
Section titled “dino_discounts_incompatible_plugins”- Description: Filters the map of incompatible plugin basenames to display names.
- Since: 4.2.0
- File:
includes/ConflictDetector.php:109 - Params: 1 argument(s), no
@paramdocblock - Example:
add_filter( 'dino_discounts_incompatible_plugins', function( $arg1 ) {return $arg1;}, 10, 1 );
dino_discounts_inline_script_data
Section titled “dino_discounts_inline_script_data”- Description: Filter the inline JSON string before it is embedded in
- Since: 2.6.0
- File:
includes/Frontend.php:533 - Params:
string $json,array $payload - Parameter detail:
$json(string) — JSON-encoded discount payload.$payload(array) — Raw payload array before encoding.
- Example:
add_filter( 'dino_discounts_inline_script_data', function( $json, $payload ) {return $json;}, 10, 2 );
dino_discounts_locate_template
Section titled “dino_discounts_locate_template”- Description: Filter the resolved template path.
- Since: unknown
- File:
includes/Storefront/template-functions.php:47 - Params:
string $template,string $template_name - Parameter detail:
$template(string) — Absolute path to the template file.$template_name(string) — Relative template name that was requested.
- Example:
add_filter( 'dino_discounts_locate_template', function( $template, $template_name ) {return $template;}, 10, 2 );
dino_discounts_migration_steps
Section titled “dino_discounts_migration_steps”- Description: No description provided in source.
- Since: unknown
- File:
includes/Migrations.php:427 - Params: 1 argument(s), no
@paramdocblock - Example:
add_filter( 'dino_discounts_migration_steps', function( $arg1 ) {return $arg1;}, 10, 1 );
dino_discounts_nudge_html
Section titled “dino_discounts_nudge_html”- Description: Filter the complete nudge HTML before output.
- Since: unknown
- File:
includes/Storefront/SpendMoreNudge.php:234 - Params:
string $html,array $rule,float $delta,string $context - Parameter detail:
$html(string)$rule(array) — Section-shaped rule.$delta(float) — Gap to next threshold.$context(string) — ‘mini’ | ‘cart’ | ‘checkout’.
- Example:
add_filter( 'dino_discounts_nudge_html', function( $html, $rule, $delta, $context ) {return $html;}, 10, 4 );
dino_discounts_nudge_rules
Section titled “dino_discounts_nudge_rules”- Description: Filter the set of candidate nudge rules before the closest is chosen.
- Since: unknown
- File:
includes/Storefront/SpendMoreNudge.php:386 - Params:
array $candidates,string $context - Parameter detail:
$candidates(array) — Each element is { rule, delta, metric, next_tier }.$context(string)
- Example:
add_filter( 'dino_discounts_nudge_rules', function( $candidates, $context ) {return $candidates;}, 10, 2 );
dino_discounts_performance_monitor
Section titled “dino_discounts_performance_monitor”- Description: Filter the performance monitor instance used across runtime services. Returning a PerformanceMonitor instance overrides the default singleton. Returning null keeps the default singleton behavior.
- Since: 4.12.0
- File:
includes/Diagnostics/PerformanceMonitor.php:116 - Params:
PerformanceMonitor|null $monitor - Parameter detail:
$monitor(PerformanceMonitor|null) — Current monitor override (default null).
- Example:
add_filter( 'dino_discounts_performance_monitor', function( $monitor ) {return $monitor;}, 10, 1 );
dino_discounts_preview_user
Section titled “dino_discounts_preview_user”- Description: Override the current user for rule evaluation (used by the preview/debug API to inject a mock role).
- Since: 4.7.0
- File:
includes/Engine/RuleMatcher.php:151 - Params:
\WP_User|object|null $resolved_user - Parameter detail:
$resolved_user(\WP_User|object|null) — The resolved user object.
- Example:
add_filter( 'dino_discounts_preview_user', function( $resolved_user ) {return $resolved_user;}, 10, 1 );
dino_discounts_strategies
Section titled “dino_discounts_strategies”- Description: Filter the map of discount type keys to strategy class names. Add custom discount types by appending to the returned array. Each class must implement DiscountStrategyInterface.
- Since: 3.0.1
- File:
includes/Engine/RulesEngine.php:1483 - Params:
array $strategy_map,RulesEngine $engine - Parameter detail:
$strategy_map(array) — Associative array of type => class name.$engine(RulesEngine) — The current RulesEngine instance.
- Example:
add_filter( 'dino_discounts_strategies', function( $strategy_map, $engine ) {return $strategy_map;}, 10, 2 );