Subscription Hooks

Action and filter hooks for customizing subscription lifecycles, automated renewals, and payment processing

Overview

WooNooW provides a comprehensive suite of WordPress action and filter hooks that allow developers to intercept, customize, and respond to subscription lifecycle events, automated billing crons, and payment processing.


Action Hooks

Lifecycle & Status Transitions

woonoow/subscription/created

Fires immediately after a new subscription record is provisioned from an initial order.

php
do_action('woonoow/subscription/created', int $subscription_id, \WC_Order $order, \WC_Order_Item_Product $item);
ParameterTypeDescription
$subscription_idintDatabase ID of the newly created subscription.
$order\WC_OrderInitial WooCommerce purchase order.
$item\WC_Order_Item_ProductOrder item product representing the subscription.

woonoow/subscription/status_changed

Fires when a subscription status is updated via SubscriptionManager::update_status().

php
do_action('woonoow/subscription/status_changed', int $subscription_id, string $status, ?string $reason);
ParameterTypeDescription
$subscription_idintSubscription ID.
$statusstringNew subscription status (active, pending, on-hold, cancelled, expired, pending-cancel).
$reasonstring|nullOptional machine-readable reason for the status change.

woonoow/subscription/paused

Fires when an active subscription is paused by an admin or customer.

php
do_action('woonoow/subscription/paused', int $subscription_id);
ParameterTypeDescription
$subscription_idintSubscription ID moved to on-hold.

woonoow/subscription/resumed

Fires when a paused (on-hold) or pending-cancel subscription is manually resumed.

php
do_action('woonoow/subscription/resumed', int $subscription_id);
ParameterTypeDescription
$subscription_idintSubscription ID restored to active.

woonoow/subscription/auto_resumed

Fires when the daily pause scheduler (woonoow_check_pause_expirations) automatically resumes a subscription that exceeded the configured max_pause_duration_days.

php
do_action('woonoow/subscription/auto_resumed', int $subscription_id, string $reason);
ParameterTypeDescription
$subscription_idintSubscription ID.
$reasonstringAlways 'max_pause_duration_exceeded'.

woonoow/subscription/pending_cancel

Fires when a subscription is marked for cancellation at the end of the current paid period rather than immediately.

php
do_action('woonoow/subscription/pending_cancel', int $subscription_id, string $reason);
ParameterTypeDescription
$subscription_idintSubscription ID.
$reasonstringReason for cancellation.

woonoow/subscription/cancelled

Fires when a subscription is permanently cancelled (either immediately or upon expiration of the pending-cancel window).

php
do_action('woonoow/subscription/cancelled', int $subscription_id, string $reason);
ParameterTypeDescription
$subscription_idintSubscription ID.
$reasonstringCancellation reason.

woonoow/subscription/expired

Fires when a subscription reaches its predetermined end_date or when maximum failed payment retries are exhausted.

php
do_action('woonoow/subscription/expired', int $subscription_id, string $reason);
ParameterTypeDescription
$subscription_idintSubscription ID.
$reasonstringReason ('end_date_reached' or 'payment_failed').

woonoow/subscription/changed

Fires after an administrator modifies subscription properties via the admin REST API.

php
do_action('woonoow/subscription/changed', int $subscription_id, string $reason);
ParameterTypeDescription
$subscription_idintSubscription ID.
$reasonstringChange reason ('admin_update').

Renewal Processing & Billing Events

woonoow/subscription/renewal_processing

Fires inside the renewal cron loop immediately before attempting to renew a due subscription.

php
do_action('woonoow/subscription/renewal_processing', int $subscription_id);
ParameterTypeDescription
$subscription_idintSubscription ID about to be processed.

woonoow/subscription/renewal_completed

Fires inside the renewal cron loop only after a renewal payment has successfully completed (status: 'complete').

php
do_action('woonoow/subscription/renewal_completed', int $subscription_id);
ParameterTypeDescription
$subscription_idintSubscription ID whose payment completed.

woonoow/subscription/renewal_error

Fires inside the renewal cron loop if an uncaught exception is thrown during renewal execution.

php
do_action('woonoow/subscription/renewal_error', int $subscription_id, \Throwable $exception);
ParameterTypeDescription
$subscription_idintSubscription ID.
$exception\ThrowableCaught exception or throwable error.

woonoow/subscription/renewal_payment_due

Fires when a renewal order requires manual customer payment (e.g. manual payment gateway, early renewal, or payment collection retry).

php
do_action('woonoow/subscription/renewal_payment_due', int $subscription_id, \WC_Order $order);
ParameterTypeDescription
$subscription_idintSubscription ID.
$order\WC_OrderPending WooCommerce renewal order.

woonoow/subscription/renewal_reminder

Fires when the daily reminder cron identifies a subscription approaching its renewal date.

php
do_action('woonoow/subscription/renewal_reminder', object $subscription);
ParameterTypeDescription
$subscriptionobjectSubscription database record object.

woonoow/subscription/renewed

Fires when renewal payment is confirmed and next payment dates have been updated.

php
do_action('woonoow/subscription/renewed', int $subscription_id, \WC_Order $order);
ParameterTypeDescription
$subscription_idintSubscription ID.
$order\WC_OrderPaid WooCommerce renewal order.

woonoow/subscription/renewal_replayed

Fires when a renewal order is completed that was already marked with the renewal idempotency flag. Useful for downstream bridges that need to reconcile state after storage or network blips.

php
do_action('woonoow/subscription/renewal_replayed', int $subscription_id, \WC_Order $order);
ParameterTypeDescription
$subscription_idintSubscription ID.
$order\WC_OrderWooCommerce renewal order.

woonoow/subscription/renewal_failed

Fires when an auto-debit attempt fails and retry counters are incremented.

php
do_action('woonoow/subscription/renewal_failed', int $subscription_id, int $failed_payment_count);
ParameterTypeDescription
$subscription_idintSubscription ID.
$failed_payment_countintUpdated count of consecutive failed payment attempts.

woonoow/subscription/renewal_catalog_missing

Fires when renewal order creation is aborted because the catalog product or variation was trashed or deleted.

php
do_action('woonoow/subscription/renewal_catalog_missing', int $subscription_id, object $subscription);
ParameterTypeDescription
$subscription_idintSubscription ID.
$subscriptionobjectSubscription database record object.

woonoow/subscription/reactivation_invoice_created

Fires when an administrator grants a protected-price reactivation exception for a terminal subscription.

php
do_action('woonoow/subscription/reactivation_invoice_created', int $subscription_id, \WC_Order $renewal_order);
ParameterTypeDescription
$subscription_idintSubscription ID.
$renewal_order\WC_OrderNewly created protected-price renewal order.

woonoow/subscription/product_deleted_alert

Fires when a WooCommerce product associated with an active subscription is deleted.

php
do_action('woonoow/subscription/product_deleted_alert', int $subscription_id, int $post_id);
ParameterTypeDescription
$subscription_idintSubscription ID.
$post_idintDeleted WooCommerce post/product ID.

Filter Hooks

woonoow_pre_process_subscription_payment

Allows third-party code to intercept or completely short-circuit the default renewal payment processing.

php
apply_filters('woonoow_pre_process_subscription_payment', null, object $subscription, \WC_Order $order);

Parameters:

  • $pre (null|bool|string): Return true (payment succeeded), false (payment failed), or 'manual' (awaiting customer payment) to bypass core logic.
  • $subscription (object): Subscription database record object (stdClass).
  • $order (\WC_Order): The WooCommerce renewal order.

woonoow_process_subscription_payment

Allows custom payment gateway adapters (e.g., Stripe, PayPal) to execute tokenized auto-debit charges for renewal orders.

php
apply_filters('woonoow_process_subscription_payment', null, \WC_Payment_Gateway $gateway, \WC_Order $order, object $subscription);

Parameters:

  • $result (null|bool): Return true if charge succeeded, false if charge failed.
  • $gateway (\WC_Payment_Gateway): Available WooCommerce payment gateway instance.
  • $order (\WC_Order): The WooCommerce renewal order.
  • $subscription (object): Subscription database record object (stdClass).

woonoow_gateway_subscription_capabilities

Filters the gateway capability map determining whether individual payment methods support tokenized recurring auto-debit.

php
apply_filters('woonoow_gateway_subscription_capabilities', array $capabilities);

Parameters:

  • $capabilities (array): Associative array mapping gateway IDs to capability booleans:
    php
    [
        'stripe' => ['auto_renew' => true, 'card_change' => true],
        'bacs'   => ['auto_renew' => false, 'card_change' => false],
    ]
    

woonoow_license_webhook_settings

Filters the outbound license webhook configuration before queueing or delivering notifications.

php
apply_filters('woonoow_license_webhook_settings', array $settings);

Parameters:

  • $settings (array): Associative array containing:
    • 'url' (string): Target endpoint URL.
    • 'secret' (string): Shared secret string for HMAC-SHA256 calculation.

Last updated Sep 11, 2026