Skip to content

Hook Reference

{/* AUTO-GENERATED from ../docs/hooks.md by scripts/sync-dev-docs.mjs — do not edit by hand. */}

Generated 2026-10-31 from 3bb9511a4. Do not edit by hand — run make docs-hooks to regenerate.

Drift check: make docs-hooks-check (also runs in make qa).

Actions (13)

Filters (44)

  • Description: Fires after all virtual coupons have been applied.
  • Since: 4.0.0
  • File: includes/Cart/Traits/AppliesDiscount.php:1426
  • 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 );
  • Description: Fires after a storefront template has been loaded.
  • Since: unknown
  • File: includes/Storefront/template-functions.php:91
  • 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:648
  • 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 );
  • Description: Fires before any virtual coupons are applied.
  • Since: 4.0.0
  • File: includes/Cart/Traits/AppliesDiscount.php:964
  • 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 );
  • Description: Fires before a storefront template is loaded.
  • Since: unknown
  • File: includes/Storefront/template-functions.php:75
  • 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 );
  • 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
  • File: includes/API/AbstractController.php:396
  • Params: none
  • Example:
    add_action( 'dino_discounts_cache_flush', function() {
    // ...
    }, 10, 0 );
  • Description: Fires with a complete discount summary for analytics or banners.
  • Since: 3.0.1
  • File: includes/Cart/Traits/AppliesDiscount.php:1450
  • Params: array $summary, object $cart
  • Parameter detail:
    • $summary (array) — Discount summary data for the current cart.
      • $discounts (array) — The discount result arrays applied this calc.
      • $total_discount (float) — Sum of resolved discount amounts.
      • $cart_subtotal (float) — Cart subtotal the discounts were computed against.
      • $currency (string) — Active currency code.
    • $cart (object) — The WooCommerce cart object.
  • Example:
    add_action( 'dino_discounts_cart_discount_summary', function( $summary, $cart ) {
    // ...
    }, 10, 2 );
  • Description: Fires after a single virtual discount coupon has been applied.
  • Since: 4.3.0
  • File: includes/Cart/Traits/AppliesDiscount.php:1416
  • 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 );
  • Description: Fires exactly once when a store moves from zero rules to one-or-more. Payload is a list of STABLE public rule summaries ({@see \DinoDiscounts\API\PublicRuleSummary::for_rule}), matching the sibling dino_discounts_rules_saved action — never the raw internal rule arrays.
  • Since: 4.8.0
  • File: includes/API/RulesController.php:946
  • Params: array<int,array{id:string,name:string,type:string,is_active:bool,exclusive:bool,promotion_id:?string}> $rule_summaries
  • Parameter detail:
    • $rule_summaries (array<int,array{id:string,name:string,type:string,is_active:bool,exclusive:bool,promotion_id:?string}>) — The rules that were just saved, as public summaries.
  • Example:
    add_action( 'dino_discounts_first_rule_published', function( $rule_summaries ) {
    // ...
    }, 10, 1 );
  • Description: Fires once the Freemius SDK has initialised (Freemius’s <prefix>_fs_loaded convention). The old name dd_fs_loaded still fires, deprecated.
  • Since: unknown
  • File: includes/Billing/Freemius.php:253
  • Params: none
  • Example:
    add_action( 'dino_discounts_fs_loaded', function() {
    // ...
    }, 10, 0 );

dino_discounts_rule_write_schema_violation

Section titled “dino_discounts_rule_write_schema_violation”
  • Description: Fires when a rule write emits an out-of-schema rule, in production and CI alike. Also available as the RuleWriteGuard::VIOLATION_ACTION constant.
  • Since: unknown
  • File: includes/Engine/Schema/RuleWriteGuard.php:271
  • Params: string $context, array<int,array<int,array{path:string,message:string}>> $violations
  • Parameter detail:
    • $context (string) — Write-site label.
    • $violations (array<int,array<int,array{path:string,message:string}>>) — Per-rule validator errors, keyed by rule index.
  • Example:
    add_action( 'dino_discounts_rule_write_schema_violation', function( $context, $violations ) {
    // ...
    }, 10, 2 );
  • Description: Fires after the discount rules have been saved. The payload is a list of STABLE public rule summaries ({@see \DinoDiscounts\API\PublicRuleSummary::for_rule}), NOT the raw internal rule arrays. Each element carries only identity / chrome fields — id, name, type, is_active, exclusive, promotion_id — never the mid-migration trigger/rewards pools[] / reward_target schema or any legacy eligible_items envelope. Array order is the engine’s evaluation order (the merchant’s admin reorder), no priority sort applied.
  • Since: 4.3.0
  • Files:
    • includes/API/RulesController.php:924
    • includes/StarterData/ResetManager.php:182
  • Params: array<int,array{id:string,name:string,type:string,is_active:bool,exclusive:bool,promotion_id:?string}> $rule_summaries
  • Parameter detail:
    • $rule_summaries (array<int,array{id:string,name:string,type:string,is_active:bool,exclusive:bool,promotion_id:?string}>) — Saved rules as public summaries, in engine evaluation order.
  • Example:
    add_action( 'dino_discounts_rules_saved', function( $rule_summaries ) {
    // ...
    }, 10, 1 );
  • Description: Fires after the global settings have been saved.
  • Since: 4.3.0
  • File: includes/API/SettingsController.php:347
  • Params: array $settings
  • Parameter detail:
    • $settings (array) — The saved settings, sanitized.
  • Example:
    add_action( 'dino_discounts_settings_saved', function( $settings ) {
    // ...
    }, 10, 1 );
  • Description: Filter the active-rule cap in force. Final say: return null for unlimited, or an integer cap. Lets support lift a cap on an install whose licence Freemius cannot see, or pin one for verification.
  • Since: unknown
  • File: includes/Billing/ActiveRuleCap.php:147
  • Params: int|null $cap
  • Parameter detail:
    • $cap (int|null) — The resolved cap, null for unlimited.
  • Example:
    add_filter( 'dino_discounts_active_rule_cap', function( $cap ) {
    return $cap;
    }, 10, 1 );
  • Description: Filter the capability required to submit a bug report. Defaults to edit_posts, which excludes the bare subscriber / customer roles that WooCommerce self-registration creates while still admitting the non-admin staff and beta testers we want to hear from. Public-registration stores that want to lock the route down further can return a higher capability (e.g. manage_woocommerce); a closed beta that wants to open it to a specific role can return a lower one or a custom capability granted to its testers. Returning an empty string disables the capability gate entirely (logged-in only) — do that only on trusted, closed installs.
  • Since: 4.56.1
  • File: includes/API/BugReportController.php:212
  • Params: string $capability
  • Parameter detail:
    • $capability (string) — Capability required to submit. Default edit_posts.
  • Example:
    add_filter( 'dino_discounts_bug_report_capability', function( $capability ) {
    return $capability;
    }, 10, 1 );
  • 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 to admin_email would 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:535
  • 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 );
  • 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:229
  • Params: string $url
  • Parameter detail:
    • $url (string) — The endpoint URL.
  • Example:
    add_filter( 'dino_discounts_bug_report_url', function( $url ) {
    return $url;
    }, 10, 1 );
  • 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: unknown
  • File: includes/Diagnostics/CacheCompatChecker.php:56
  • Params: CacheCompatPluginChecker[] $checkers
  • Parameter detail:
    • $checkers (CacheCompatPluginChecker[]) — Default registry.
  • Example:
    add_filter( 'dino_discounts_cache_compat_checkers', function( $checkers ) {
    return $checkers;
    }, 10, 1 );
  • Description: Filters the map of caching plugin basenames to display names.
  • Since: 4.7.0
  • Files:
    • includes/ConflictDetector.php:504
    • includes/Diagnostics/UnpurgeablePageCacheDetector.php:279
  • Params: array<string,string> $plugins
  • Parameter detail:
    • $plugins (array<string,string>) — Basename => display name pairs.
  • Example:
    add_filter( 'dino_discounts_caching_plugins', function( $plugins ) {
    return $plugins;
    }, 10, 1 );

dino_discounts_cap_reservation_cancel_grace

Section titled “dino_discounts_cap_reservation_cancel_grace”
  • Description: Filter how long a still-payable pending order must age before the cap-reservation sweep may cancel it. Defaults to the LONGER of the reservation TTL and the store’s woocommerce_hold_stock_minutes window, so the sweep defers to a store that keeps unpaid orders alive longer. The effective value is floored at the reservation TTL.
  • Since: 4.59.40
  • File: includes/Engine/CapReservation.php:301
  • Params: int $grace, int $hold, int $reservation_ttl
  • Parameter detail:
    • $grace (int) — Default grace (seconds).
    • $hold (int) — Store unpaid-order hold window (seconds, 0 if none).
    • $reservation_ttl (int) — Reservation TTL (seconds).
  • Example:
    add_filter( 'dino_discounts_cap_reservation_cancel_grace', function( $grace, $hold, $reservation_ttl ) {
    return $grace;
    }, 10, 3 );
  • Description: Filter the client IP the store-wide cap-reservation throttle keys on. Sites behind a reverse proxy / CDN should return the true client IP so the per-client throttle doesn’t collapse every visitor into the proxy’s single bucket. Return ” to disable IP-keying (the throttle then fails open).
  • Since: 4.59.40
  • File: includes/Support/CapReservationThrottle.php:216
  • Params: string $ip
  • Parameter detail:
    • $ip (string) — The request IP (REMOTE_ADDR), or ” if none.
  • Example:
    add_filter( 'dino_discounts_cap_reservation_client_ip', function( $ip ) {
    return $ip;
    }, 10, 1 );
  • Description: Filter the store-wide cap-reservation ceiling per client per window. Return 0 (or any value <= 0) to disable the throttle entirely.
  • Since: 4.59.40
  • File: includes/Support/CapReservationThrottle.php:125
  • Params: int $limit
  • Parameter detail:
    • $limit (int) — Default {@see RESERVATION_LIMIT}.
  • Example:
    add_filter( 'dino_discounts_cap_reservation_rate_limit', function( $limit ) {
    return $limit;
    }, 10, 1 );
  • Description: Filter the usage-cap reservation TTL (seconds). A reserved slot whose order never progressed past placement is released once it is older than this. Raise it for stores with slow off-site gateways; the effective value is floored at 60s.
  • Since: unknown
  • File: includes/Engine/CapReservation.php:236
  • Params: int $ttl
  • Parameter detail:
    • $ttl (int) — Reservation TTL in seconds (default 3600).
  • Example:
    add_filter( 'dino_discounts_cap_reservation_ttl', function( $ttl ) {
    return $ttl;
    }, 10, 1 );
  • Description: Register a checkout’s order-summary container so dino can re-render it after an express-checkout (Apple Pay / Google Pay / Link) decline. Out of the box dino finds the summary by Essential Addons’ review table, WooCommerce’s review-order classes (.woocommerce-checkout-review-order-table, .woocommerce-checkout-review-order), the table directly inside #order_review (#order_review > table) and the cart page’s .cart_totals. A checkout that renders none of those keeps showing the declined discount until the shopper reloads, unless its summary is registered here. Registered selectors are tried before the built-in ones. The container is replaced wholesale with the same element from a fresh server render, so register the smallest element that holds the totals. Same selector grammar as dino_discounts_mini_cart_selectors. add_filter( ‘dino_discounts_checkout_summary_selectors’, function ( $selectors ) { $selectors[] = ‘.my-checkout-summary’; return $selectors; } );
  • Since: unknown
  • File: includes/Storefront/SurfaceSelectors.php:124
  • Params: array $selectors
  • Parameter detail:
    • $selectors (array) — Empty list.
  • Example:
    add_filter( 'dino_discounts_checkout_summary_selectors', function( $selectors ) {
    return $selectors;
    }, 10, 1 );
  • Description: Filter whether the current checkout is rendered by EAEL’s “Woo Checkout” widget — the signal that drives the top-band spend-more nudge remap ({@see self::resolve_render_position()}). Auto-detection covers the widget delivered as checkout-page content and via a published Elementor Theme Builder template; a store with an unusual delivery (or one that wants to opt out) can force the verdict.
  • Since: unknown
  • File: includes/Storefront/SpendMoreNudge.php:825
  • Params: bool $detected
  • Parameter detail:
    • $detected (bool) — Whether dino auto-detected the EAEL Woo-Checkout widget.
  • Example:
    add_filter( 'dino_discounts_checkout_uses_eael', function( $detected ) {
    return $detected;
    }, 10, 1 );
  • Description: Filter whether the Compatibility Center treats Essential Addons as present. Its two Essential Addons entries are measured, and offered, only where the plugin loaded in this request. A store delivering that checkout some other way — a fork or a bundled copy — can say so here.
  • Since: unknown
  • File: includes/Compat/CompatRegistry.php:1806
  • Params: bool $loaded
  • Parameter detail:
    • $loaded (bool) — Whether Essential Addons loaded in this request.
  • Example:
    add_filter( 'dino_discounts_compat_eael_present', function( $loaded ) {
    return $loaded;
    }, 10, 1 );
  • Description: Filters which curated compatibility entries a site offers. Removal only. The callback is handed a list of entry ids and whatever it returns is intersected back against the shipped set, so it can drop one of our workarounds but cannot add an entry of its own, nor point a shipped id at a substituted object. Return the ids to keep — e.g. array_diff( $ids, array( 'some-entry-id' ) ).
  • Since: 4.59.70
  • File: includes/Compat/CompatRegistry.php:1958
  • Params: list<string> $ids
  • Parameter detail:
    • $ids (list) — Ids of every shipped, validated entry.
  • Example:
    add_filter( 'dino_discounts_compat_entries', function( $ids ) {
    return $ids;
    }, 10, 1 );
  • Description: Filter the coupon display label before it is stored.
  • Since: 4.0.0
  • File: includes/Cart/DiscountLine.php:219
  • Params: string $label, array $discount, object $cart
  • Parameter detail:
    • $label (string) — The sanitized coupon label.
    • $discount (array) — The discount result array.
    • $cart (object) — The WC_Cart, or the Cart Preview’s VirtualCart (not a WC_Cart).
  • Example:
    add_filter( 'dino_discounts_coupon_label', function( $label, $discount, $cart ) {
    return $label;
    }, 10, 3 );
  • Description: Filter the discount data payload before it is consumed by JS.
  • Since: 2.6.0
  • File: includes/Frontend.php:1081
  • 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 );
  • Description: Filter to disable the cart-UI sync layer entirely. Returning false skips 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’ ); Note: disabling the sync layer also disables the page-surface mini-nudge dedupe (scrubMiniNudgesOnPageSurfaces), so the mini-cart nudge may duplicate the page-level nudge on cart/checkout pages. Origin: REFACTOR-CART-UI-SYNC-LAYER.
  • Since: unknown
  • File: includes/Frontend.php:1229
  • Params: bool $enabled
  • Parameter detail:
    • $enabled (bool) — Default true.
  • Example:
    add_filter( 'dino_discounts_enable_cart_ui_sync', function( $enabled ) {
    return $enabled;
    }, 10, 1 );
  • Description: Filter whether the pooled_match discount family (Mix-BOGOF redesign) is enabled. Default true post-PM-9 cutover. add_filter( ‘dino_discounts_enable_pooled_match’, ‘__return_false’ );
  • Since: 4.51.0
  • File: includes/Engine/DiscountType.php:246
  • Params: bool $enabled
  • Parameter detail:
    • $enabled (bool) — Default true.
  • Example:
    add_filter( 'dino_discounts_enable_pooled_match', function( $enabled ) {
    return $enabled;
    }, 10, 1 );
  • Description: Filter the list of enabled currency codes for the store’s roster. Multi-currency plugins can hook here to add their active currencies. Each entry should be a WooCommerce currency code (e.g. ‘EUR’, ‘USD’). The roster feeds the admin payload’s currency picker AND the engine’s money_without_currency runnability gate — this filter is the documented escape hatch for switchers the auto-detection below doesn’t recognise.
  • Since: 4.3.8
  • File: includes/Utils/EnabledCurrencies.php:137
  • 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_engine_has_resolved_rewards

Section titled “dino_discounts_engine_has_resolved_rewards”
  • Description: Whether Dino’s engine has resolved any reward for the calculate pass now running. false means this pass cannot harvest — a consumer must neither read a reward’s amount or label from it nor treat it as a capture. Frontend holds no direct reference to CartCoupons (see dino_discounts_enrich_frontend_payload below for the same seam), and the answer must come from the instance actually hooked to this pass — not a singleton. Defaults to true, so a stack with no Dino cart layer hooked harvests exactly as it did before. CartCoupons answers authoritatively at priority 10 and ignores the incoming value, so a third party overriding it must hook LATER than 10.
  • Since: unknown
  • File: includes/Frontend.php:417
  • Params: bool $resolved
  • Parameter detail:
    • $resolved (bool) — Whether any reward is resolved for this pass.
  • Example:
    add_filter( 'dino_discounts_engine_has_resolved_rewards', function( $resolved ) {
    return $resolved;
    }, 10, 1 );

dino_discounts_enqueue_eael_checkout_guards

Section titled “dino_discounts_enqueue_eael_checkout_guards”
  • Description: Filter whether dino ships its two EAEL classic-checkout guards. The detector answers “did Essential Addons load in this request”. A store delivering the .ea-woo-checkout markup some other way — a cached render, a fork, a bundled copy — can force the guards back on without editing dino.
  • Since: 4.59.67
  • File: includes/Frontend.php:1631
  • Params: bool $loaded
  • Parameter detail:
    • $loaded (bool) — Whether dino detected Essential Addons in this request.
  • Example:
    add_filter( 'dino_discounts_enqueue_eael_checkout_guards', function( $loaded ) {
    return $loaded;
    }, 10, 1 );
  • Description: Enrich the storefront discount payload before it is exposed to JS. Frontend does not hold a direct reference to CartCoupons, so the per-discount reward_type (and any other integration fields) is attached here: CartCoupons hooks this filter to enrich each entry. Headless / Block integrations can attach additional fields to window.dinoDiscountsMiniCart without overriding a template.
  • Since: 4.2.0
  • File: includes/Frontend.php:1067
  • Params: array[] $discounts
  • Parameter detail:
    • $discounts (array[]) — The discount entries for the storefront payload; each entry carries at least ‘name’ (string) and ‘amount’ (float).
  • Example:
    add_filter( 'dino_discounts_enrich_frontend_payload', function( $discounts ) {
    return $discounts;
    }, 10, 1 );
  • Description: Filter the per-rule work-unit cap for one cart evaluation. A rule that exceeds it is skipped (no discount from that rule) and logged at error level; the other rules still apply. Defaults to 25000000, or the DINO_DISCOUNTS_EVAL_RULE_ITERATION_CAP constant when defined. 0 or less disables the limit.
  • Since: unknown
  • File: includes/Engine/EvaluationBudget.php:294
  • Params: int $cap
  • Parameter detail:
    • $cap (int) — Work units one rule may spend.
  • Example:
    add_filter( 'dino_discounts_eval_rule_iteration_cap', function( $cap ) {
    return $cap;
    }, 10, 1 );
  • Description: Filter the wall-clock budget, in milliseconds, for one cart evaluation’s rule loop. When it is spent the evaluation is abandoned, logged at error level, and the cart gets no discounts. Defaults to 5000, or the DINO_DISCOUNTS_EVAL_TIME_BUDGET_MS constant when defined. 0 or less disables the limit.
  • Since: unknown
  • File: includes/Engine/EvaluationBudget.php:283
  • Params: int $budget_ms
  • Parameter detail:
    • $budget_ms (int) — Time budget in milliseconds.
  • Example:
    add_filter( 'dino_discounts_eval_time_budget_ms', function( $budget_ms ) {
    return $budget_ms;
    }, 10, 1 );
  • Description: Filter the final set of applied discounts before they are returned.
  • Since: 2.5.0
  • File: includes/Engine/RulesEngine.php:924
  • Params: array $applied_discounts, \WC_Cart $cart, array $context
  • Parameter detail:
    • $applied_discounts (array) — Array of internal discount result arrays (unstable shape).
    • $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 );
  • Description: Filters the map of incompatible plugin basenames to display names.
  • Since: 4.2.0
  • Files:
    • includes/ConflictDetector.php:381
    • includes/ConflictDetector.php:449
  • Params: array<string,string> $plugins
  • Parameter detail:
    • $plugins (array<string,string>) — Basename => display name pairs.
  • Example:
    add_filter( 'dino_discounts_incompatible_plugins', function( $plugins ) {
    return $plugins;
    }, 10, 1 );
  • Description: Filter the inline JSON string before it is embedded in
  • Since: 2.6.0
  • File: includes/Frontend.php:2413
  • 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 );
  • Description: Filter the founding verdict. Final say in both directions: return true to record a Founding award by hand on an install Freemius cannot see, or false to revoke one.
  • Since: unknown
  • File: includes/Beta/FoundingInstall.php:172
  • Params: bool $founding
  • Parameter detail:
    • $founding (bool) — Whether the install holds an earned Founding licence or a grandfathered latch.
  • Example:
    add_filter( 'dino_discounts_is_founding_install', function( $founding ) {
    return $founding;
    }, 10, 1 );
  • Description: Filter the resolved template path.
  • Since: unknown
  • File: includes/Storefront/template-functions.php:48
  • 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 );
  • Description: Filters the ordered migration milestones.
  • Since: 4.28.0
  • File: includes/Migrations.php:853
  • Params: array[] $steps
  • Parameter detail:
    • $steps (array[]) — Ordered migration steps; each is an array with ‘key’, ‘after’, and ‘run’ (callable).
  • Example:
    add_filter( 'dino_discounts_migration_steps', function( $steps ) {
    return $steps;
    }, 10, 1 );
  • Description: Register a theme’s own mini-cart drawer so dino places its discount lines and spend-more nudges in it. dino decorates the classic cart widget, the Elementor Menu Cart and the WooCommerce Mini-Cart block out of the box. A drawer outside that list gets nothing from dino until it is registered here. Each role takes a list of CSS selectors, one selector per entry: drawer matches the drawer container (every match on the page is decorated), footer the button row dino’s lines sit above, subtotal the row they sit below when there is no footer, and items the product list nudges sit around. A drawer is decorated only once its product list has rendered inside it, matched by items or by WooCommerce’s own mini-cart list, so a drawer that renders its own list needs both drawer and items. With neither a footer nor a subtotal match, the lines go at the end of the drawer. Per-line attribution and the “Free” gift badge stay on the built-in drawers’ line markup. Selectors are limited to type, class, id and attribute selectors joined by combinators. Anything else (pseudo-classes, commas, escapes) is dropped, because one invalid selector would stop the browser matching every drawer, the built-in ones included. add_filter( ‘dino_discounts_mini_cart_selectors’, function ( $selectors ) { $selectors[‘drawer’][] = ‘.my-theme-cart-drawer’; $selectors[‘items’][] = ‘.my-theme-cart-drawer__products’; $selectors[‘footer’][] = ‘.my-theme-cart-drawer__actions’; return $selectors; } );
  • Since: unknown
  • File: includes/Storefront/SurfaceSelectors.php:77
  • Params: array $selectors
  • Parameter detail:
    • $selectors (array) — Keys drawer, footer, subtotal, items, each an empty list.
  • Example:
    add_filter( 'dino_discounts_mini_cart_selectors', function( $selectors ) {
    return $selectors;
    }, 10, 1 );
  • Description: Filters the map of unsupported multi-currency plugin class names to display names. Add an entry here when you ship a new plugin we should warn merchants about; remove an entry once Dino Discounts integrates with that plugin’s price-lookup API. The list is also the display-name source for the country-source geography warning, and a class listed here that Dino Discounts has no pricing basis for is treated as a plugin whose pricing address cannot be read — so registering a plugin here earns it that advisory too.
  • Since: 4.43.7
  • File: includes/ConflictDetector.php:800
  • Params: array<string,string> $plugins
  • Parameter detail:
    • $plugins (array<string,string>) — Class-name => display-name pairs.
  • Example:
    add_filter( 'dino_discounts_multi_currency_plugins', function( $plugins ) {
    return $plugins;
    }, 10, 1 );
  • Description: Filter the complete nudge HTML before output. The $rule_summary arg is the STABLE public rule summary ({@see \DinoDiscounts\API\PublicRuleSummary::for_rule}) — read-only context for the integrator deciding how to adjust the HTML. It is intentionally NOT the raw internal rule: the mid-migration trigger/rewards pools[] / reward_target schema and any legacy eligible_items envelope are never exposed here. The $rule context arg was narrowed from the raw internal rule to a public {@see \DinoDiscounts\API\PublicRuleSummary} summary (api-hooks-leak-internal-rule-shape).
  • Since: unknown
  • File: includes/Storefront/SpendMoreNudge.php:991
  • Params: string $html, array{id:string,name:string,type:string,is_active:bool,exclusive:bool,promotion_id:?string} $rule_summary, float $delta, string $context
  • Parameter detail:
    • $html (string) — The rendered nudge markup (the filtered/return value).
    • $rule_summary (array{id:string,name:string,type:string,is_active:bool,exclusive:bool,promotion_id:?string}) — Public summary of the nudging rule.
    • $delta (float) — Gap to next threshold.
    • $context (string) — ‘mini’ | ‘cart’ | ‘checkout’.
  • Example:
    add_filter( 'dino_discounts_nudge_html', function( $html, $rule_summary, $delta, $context ) {
    return $html;
    }, 10, 4 );
  • Description: Filter the set of candidate nudge rules before the closest is chosen.
  • Since: unknown
  • File: includes/Storefront/SpendMoreNudge.php:1282
  • Params: array $candidates, string $context
  • Parameter detail:
    • $candidates (array) — Each element is { rule, delta, metric, next_tier }; rule is internal/unstable.
    • $context (string)
  • Example:
    add_filter( 'dino_discounts_nudge_rules', function( $candidates, $context ) {
    return $candidates;
    }, 10, 2 );
  • 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:123
  • 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 );
  • 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:205
  • 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 );
  • Description: Filters the pricing-country provider dino compares its own country_source against. The extension point for a multi-currency plugin dino does not ship support for: return the same shape with a basis of billing or shipping and the merchant gets the full mismatch warning, including the one-click alignment, instead of the generic advisory. The shape is class, label, setting (all strings) and basis, which must be one of billing, shipping, none or unknown; return null, or anything else, and the resolved provider stands unchanged.
  • Since: 4.59.87
  • File: includes/ConflictDetector.php:990
  • Params: array|null $provider
  • Parameter detail:
    • $provider (array|null) — Resolved provider, or null.
  • Example:
    add_filter( 'dino_discounts_pricing_country_basis', function( $provider ) {
    return $provider;
    }, 10, 1 );

dino_discounts_smart_coupons_auto_apply_conflict

Section titled “dino_discounts_smart_coupons_auto_apply_conflict”
  • Description: Filters whether Dino Discounts warns about the Smart Coupons auto-apply × Essential Addons checkout collision. The result also decides the Compatibility Center row (smart-coupons-auto-apply-eael), not only the notice. Return false to silence the notice on a store that has accepted the behaviour, or true to force it where the detection cannot see the offending listener (a bespoke integration re-checking the update-order-review nonce under another class name, say). Origin: bug-eael-summary-stale-paint-after-coupon-apply.
  • Since: unknown
  • File: includes/ConflictDetector.php:1356
  • Params: bool $detected
  • Parameter detail:
    • $detected (bool) — Whether the collision was detected.
  • Example:
    add_filter( 'dino_discounts_smart_coupons_auto_apply_conflict', function( $detected ) {
    return $detected;
    }, 10, 1 );
  • Description: Filter the resolved on-page promotional discount message before it is passed to the storefront template, so copy/markup tweaks do not force a full storefront/discount-message.php template override. Mirrors the dino_discounts_nudge_html filter. The $message value has already had its [placeholders] replaced and is wp_kses_post-escaped at render time by the template, so a filter may return safe inline HTML. The $rule_summary arg is the STABLE public rule summary ({@see \DinoDiscounts\API\PublicRuleSummary::for_rule}) — read-only context for the integrator deciding how to adjust the copy. It is intentionally NOT the raw internal rule: the mid-migration trigger/rewards pools[] / reward_target schema and any legacy eligible_items envelope are never exposed here.
  • Since: unknown
  • File: includes/Storefront/StorefrontDisplay.php:304
  • Params: string $message, array{id:string,name:string,type:string,is_active:bool,exclusive:bool,promotion_id:?string} $rule_summary, \WC_Product $product
  • Parameter detail:
    • $message (string) — The resolved, placeholder-replaced message (the filtered/return value).
    • $rule_summary (array{id:string,name:string,type:string,is_active:bool,exclusive:bool,promotion_id:?string}) — Public summary of the rule the message belongs to.
    • $product (\WC_Product) — The product the message renders on.
  • Example:
    add_filter( 'dino_discounts_storefront_message', function( $message, $rule_summary, $product ) {
    return $message;
    }, 10, 3 );
  • Description: Filter the map of discount type keys to strategy class names. Replaces a built-in kind’s class only; the rule schema rejects any other kind. Each class must implement DiscountStrategyInterface.
  • Since: 3.0.1
  • File: includes/Engine/RulesEngine.php:1101
  • 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 );
  • Description: Filter the website privacy-notice URL linked from the consent surfaces.
  • Since: 4.59.0
  • File: includes/Telemetry/ConsentPrompt.php:378
  • Params: string $url
  • Parameter detail:
    • $url (string) — The privacy-notice URL.
  • Example:
    add_filter( 'dino_discounts_telemetry_privacy_url', function( $url ) {
    return $url;
    }, 10, 1 );
  • Description: Filter the telemetry ingest endpoint URL. Return ” (the default) to keep telemetry inert regardless of consent — nothing is POSTed without a configured endpoint. The listeners register at plugins_loaded, so add the filter in an mu-plugin (or use the constant) for them to run.
  • Since: 4.59.0
  • File: includes/Telemetry/Telemetry.php:413
  • Params: string $url
  • Parameter detail:
    • $url (string) — The endpoint URL.
  • Example:
    add_filter( 'dino_discounts_telemetry_url', function( $url ) {
    return $url;
    }, 10, 1 );
  • Description: Filter the client IP the ?dino_apply throttle keys on. Sites behind a reverse proxy / CDN should return the true client IP (e.g. from CF-Connecting-IP or a trusted X-Forwarded-For) so the per-client throttle doesn’t collapse every visitor into the proxy’s single bucket. Return ” to disable IP-keying (the throttle then fails open). Untrusted X-Forwarded-For is intentionally NOT read by default — it is spoofable, which would let an attacker reset the counter per request; opting into it is the site’s decision.
  • Since: 4.59.37
  • File: includes/Support/FailedApplyThrottle.php:220
  • Params: string $ip
  • Parameter detail:
    • $ip (string) — The request IP (REMOTE_ADDR), or ” if none.
  • Example:
    add_filter( 'dino_discounts_url_apply_client_ip', function( $ip ) {
    return $ip;
    }, 10, 1 );
  • Description: Filter the failed-?dino_apply-attempt ceiling. Return 0 (or any value <= 0) to disable the throttle entirely.
  • Since: 4.59.37
  • File: includes/Support/FailedApplyThrottle.php:123
  • Params: int $limit
  • Parameter detail:
    • $limit (int) — Default {@see FAILURE_LIMIT}.
  • Example:
    add_filter( 'dino_discounts_url_apply_failure_limit', function( $limit ) {
    return $limit;
    }, 10, 1 );

WooCommerce is a trademark of Automattic, Inc. WordPress is a trademark of the WordPress Foundation. Dino Discounts is not affiliated with or endorsed by Automattic or the WordPress Foundation.

Contact · Report a bug