Esta página documenta todas las actions y filters definidos por el plugin. No incluye hooks de WordPress core o WooCommerce a los que el plugin solo se engancha.
Usa el buscador para filtrar por nombre de hook. Usa los chips de tipo para mostrar solo actions, solo filters, o solo los 20 hooks bridge-only. Haz clic en el nombre de cualquier hook para copiar un enlace directo.
La fuente de verdad vive en docs/hooks-reference.md en el repositorio del plugin. Esta página HTML se genera a partir de ese archivo y se mantiene sincronizada release a release. Las descripciones técnicas se conservan en inglés (igual que los nombres de hook y los snippets de código) por coherencia con la documentación del sector.
Filters the args array passed internally to the subscription creator. Differs from aswc_subscription_post_data in that it carries the higher-level cart-derived shape (interval, period, signup fee, trial, etc.) before that data is mapped to a post.
Filters the same recurring-data array but at the moment it is read off the cart item during checkout processing (one step later than aswc_recurring_data).
Allows a third party to short-circuit subscription creation for a particular cart item. Returning false skips that item; returning true keeps the default behaviour.
Fires after the payment method has been bound to the new subscription during checkout. Use it to persist gateway-specific tokens or bridge bookkeeping.
Counterpart of the previous hook for the prorated path that runs when a plan switch creates a renewal order with a partial amount. (Note the typo propate — kept for backwards compatibility.)
Filters the value returned by the internal subscription-creation method. Useful when you need to substitute the returned ID with a different identifier (rare).
Fires when a subscription transitions to active as the result of a successful renewal payment (as opposed to first activation). Use it to differentiate first-payment vs. renewal-driven activations.
Reserved hook name for filtering the status applied during activation. Currently disabled in source; kept here as a heads-up so integrators do not pick the same name for an unrelated purpose.
Desde: 0.24.0 (extended in 2.0.0 with bridge call sites)
Type: Action
Since: 0.24.0 (extended in 2.0.0 with bridge call sites)
Files:
- public/class-aswc-public.php — customer-driven cancellation
- includes/payment-bridges/abstract-class-aswc-payment-bridge.php — bridge-driven cancellation after a full refund (since 2.0.0)
- includes/payment-bridges/stripe/class-aswc-stripe-webhooks.php — Stripe webhook-driven cancellation
- includes/payment-bridges/paypal-payments/class-aswc-paypal-payments-webhooks.php — PayPal Payments webhook-driven cancellation Fires just before processing a subscription cancellation. The hook is shared by: 1. Customer cancellation from My Account.
2. Bridge-driven cancellation when a full refund processed by a bridge is configured to cancel the subscription (see aswc_cancel_on_full_refund and aswc_bridge_cancel_subscription_on_full_refund).
3. Webhook-driven cancellation when Stripe/PayPal notifies the site that the upstream subscription has been cancelled. In bridge / webhook paths $user_id is the subscription's customer id and $status is the subscription status read from aswc_subscription_status meta immediately before cancellation.
Parámetro
Tipo
Descripción
`$subscription_id`
int
Subscription ID
`$user_id`
int
User who cancels (customer path) or subscription owner (bridge / webhook path)
Filters the timestamp returned by ASWC_Subscription::get_time() for non-standard date types (trial_end, end, next_payment and date_created are resolved without firing this hook).
Filters the boolean returned by ASWC_Subscription::is_manual(). Override only when you have an external reason to force a subscription onto manual renewal regardless of its stored payment type.
Reserved hook name used by the discount renewal counter to record completed renewals. Custom code can subscribe to it; production-side it is fired by gateway integrations after a successful renewal payment is recorded against a subscription.
Filters the backoff (in seconds) between retry attempts when the scheduler core is the one driving the retry. Pairs with aswc_payment_retry_intervals for finer control.
Fires when the retry handler executes a scheduled retry. Hook into it to plug a custom dunning workflow that reacts as the retry runs (rather than when it is scheduled).
Filters the line-item total of a renewal order per item during renewal-order creation. The Discounts module (includes/discounts/class-aswc-discounts.php) attaches to it to apply tier-based discounts to each line; third parties can use it for fine-grained adjustments. If the filter returns a value different from the original line total, the plugin proportionally adjusts the line's taxes and stores _aswc_original_total / _aswc_discount_applied meta on the order item.
Parámetro
Tipo
Descripción
`$line_total`
float
Original line item total
`$subscription_id`
int
Subscription ID
`$product_id`
int
Product ID
`$order_item`
WC_Order_Item
Order item being adjusted
Devuelve:float.
PHP
add_filter( 'aswc_renewal_order_line_item_total', function( $line_total, $subscription_id, $product_id, $order_item ) {
// Knock 10% off the line item for VIP customers.
$subscription = aswc_get_subscription( $subscription_id );
if ( user_can( $subscription->get_customer_id(), 'vip_customer' ) ) {
return round( $line_total * 0.9, 2 );
}
return $line_total;
}, 10, 4 );
Filters the order-level total of a renewal order, after individual line-item discounts have already been applied. If the filter returns a value lower than the recalculated total, the plugin adds a negative fee line ("Renewal Discount") to keep the order math consistent.
Desde: 2.0.0 (default semantics rewritten in 2.0.0)Archivo:scheduler-api/lifecycle/class-aswc-refund-handler.php
Gates whether the legacy refund handler cancels the linked subscription(s). Default value depends on the order type: - Parent (first-payment) order: defaults to true.
- Renewal order: defaults to true only when the option aswc_cancel_on_full_refund is 'yes', false otherwise.
Per-subscription gate inside the legacy handler. Runs afteraswc_cancel_subscription_on_full_refund has authorised the cancellation, once per subscription linked to the refunded order.
Filters the maximum allowed payment amount for a renewal charge. The plugin refuses to charge any renewal whose amount exceeds this value, returning a validation error rather than calling the gateway. Default: 999999. Use this filter to lower the ceiling (paranoid setups) or raise it (high-ticket B2B).
Parámetro
Tipo
Descripción
`$max_amount`
`int\
float`
Devuelve:int|float.
PHP
add_filter( 'aswc_max_payment_amount', function() {
// Cap renewals at €10,000 - alert if higher.
return 10000;
} );
Filters the maximum allowed subscription price when the admin updates a subscription from the edit screen via AJAX. Acts as a sanity guard against accidental typing errors (e.g., 100000 instead of 100). Default: 999999.
Bridge-context counterpart of aswc_cancel_subscription_on_full_refund. Fires only from the bridge-driven refund helper called by ASWC_Stripe_Webhooks and ASWC_PayPal_Payments_Webhooks.
Parámetro
Tipo
Descripción
`$should_cancel`
bool
Default driven by option aswc_cancel_on_full_refund
`$subscription`
ASWC_Subscription
Subscription
`$renewal_order`
WC_Order
Refunded renewal
`$bridge_id`
string
stripe, paypal-payments
Devuelve:bool.
PHP
add_filter( 'aswc_bridge_cancel_subscription_on_full_refund', function( $should_cancel, $subscription, $renewal_order, $bridge_id ) {
if ( 'stripe' !== $bridge_id ) {
return $should_cancel;
}
$next_payment_ts = (int) aswc_get_meta_data( $subscription->get_id(), 'aswc_next_payment_date_timestamp', true );
if ( $next_payment_ts > time() ) {
return false; // there is still prepaid term remaining.
}
return $should_cancel;
}, 10, 4 );
Fires immediately before the WooPayments bridge charges an off-session renewal. Receives the Payment_Information value object that will be sent to WC_Payment_Gateway_WCPay::process_payment_for_order(). Use this hook to log, mutate (rarely), or veto the charge.
Parámetro
Tipo
Descripción
`$payment_information`
WCPay\Payment_Information
Value object describing the upcoming charge.
`$subscription`
object
Subscription owning the saved payment token.
`$renewal_order`
WC_Order
Renewal order being charged.
PHP
add_action( 'aswc_woopayments_bridge_before_renewal_charge', function( $payment_info, $subscription, $renewal_order ) {
error_log( sprintf(
'WooPayments renewal about to charge order #%d for subscription #%d',
$renewal_order->get_id(),
$subscription->get_id()
) );
}, 10, 3 );
Filters the boolean returned by the helper that decides whether a given product is a subscription. Override only when you need to recognise a product type the plugin does not know about as a subscription.
Filters the computed length (in billing intervals) of a subscription product. The length is derived from the product's expiry settings (aswc_subscription_expiry_number and _interval) combined with the billing cadence. A length of 0 means "no expiry".
Parámetro
Tipo
Descripción
`$length`
int
Computed length in billing intervals. 0 = no expiry.
`$product`
mixed
Product object or ID.
Devuelve:int — possibly modified length.
PHP
add_filter( 'aswc_subscriptions_product_length', function( $length, $product ) {
// Cap every subscription length at 24 periods regardless of product config.
return min( $length, 24 );
}, 10, 2 );
Filters the billing period of a subscription product. The period is one of 'day', 'week', 'month', 'year', or '' if the product has no subscription configuration.
Filters the billing interval multiplier of a subscription product. The interval is a positive integer ≥ 1 that combines with the period (e.g., interval 3 + period month = "every 3 months"). Defaults to 1 if no configuration is present.
Parámetro
Tipo
Descripción
`$interval`
int
Billing interval, ≥ 1.
`$product`
mixed
Product object or ID.
Devuelve:int — modified interval.
PHP
add_filter( 'aswc_subscriptions_product_period_interval', function( $interval, $product ) {
// Force monthly even if the product was saved as bi-monthly.
return 1;
}, 10, 2 );
Filters the recurring price of a subscription product. The value comes from $product->get_price() and can be overridden, e.g., for currency-specific pricing, tiered pricing by user role, or dynamic discounts.
Filters the trial expiration timestamp (Unix, GMT) for a subscription product. Returns 0 if the product has no trial. Useful for sliding-trial logic, integrations with promo periods or seasonal extensions.
Parámetro
Tipo
Descripción
`$timestamp`
int
Unix timestamp (GMT) when the trial ends, or 0.
`$product`
mixed
Product object or ID.
`$from_date`
string
Reference date used for the calculation (GMT 'Y-m-d H:i:s').
Filters the timestamp (Unix, GMT) of the first renewal payment after the initial purchase. Returns 0 if the product never renews (single-cycle subscription).
Parámetro
Tipo
Descripción
`$timestamp`
int
Unix timestamp of the first renewal, or 0.
`$product`
mixed
Product object or ID.
`$from_date`
string
Reference date.
`$timezone`
string
'gmt' (default) or 'site'.
Devuelve:int.
PHP
add_filter( 'aswc_subscriptions_product_first_renewal_payment_time', function( $ts, $product, $from_date, $timezone ) {
// For "magazine issue" products, snap the first renewal to the 1st of next month.
if ( $ts > 0 && is_object($product) && has_term( 'magazine', 'product_cat', $product->get_id() ) ) {
return strtotime( 'first day of next month 00:00 GMT', $ts );
}
return $ts;
}, 10, 4 );
Re-emits woocommerce_before_calculate_totalsafter the plugin has finished its own cart adjustments (signup fee handling, recurring totals, prorations). Hook here when your code needs to read the cart after the plugin has rewritten it.
Loader-level filter on woocommerce_add_cart_item_data for subscription products. Used to push subscription-specific keys into the cart-item array (e.g. selected start date, plan-switch references).
Filters the HTML snippet that shows the billing cadence next to the price (e.g., / month). Fires inside aswc_subscription_product_get_price_html() when the product has an interval defined.
Parámetro
Tipo
Descripción
`$aswc_price_html`
string
HTML snippet for the interval (e.g. <span class="aswc_interval"> / month </span>).
Filters the final price HTML built for a subscription product in the classic templates (product page, classic cart, classic checkout). Last hook before the price is rendered, after trial, signup fee and expiry HTML have been concatenated.
Like aswc_show_one_time_subscription_price but applied in the Cart and Checkout Blocks context. Use this filter when customising the block UI; the classic one will not fire there.
Final filter for the recurring-price HTML returned by aswc_subscription_product_get_price_html(). Fires after all the other price-display filters. Use it as a last-mile hook to wrap or annotate the full price.
Filters the per-line price used in the classic cart for subscription products. Called twice depending on whether a signup fee applies: once with the signup fee, once with 0.
Filters the unit recurring price computed for a cart item (line total ÷ quantity, optionally including tax). Useful when you want to bypass the standard line-total calculation, e.g., for tiered or volumetric pricing.
Filters the price HTML displayed on the product page right before passing it to the wrapper that adds interval / trial / signup HTML. Named for compatibility with the role-based pricing add-on, but available even when that add-on is not installed.
Filters the structured price-data payload sent to the Cart Blocks (Store API) for a subscription line item. The payload is an associative array with at least name, hidden and value. Use this hook to inject additional data fields the block UI can consume.
Filters the formatted recurring total displayed in the admin subscriptions list table (WooCommerce → Subscriptions). Use it to add per-subscription currency markers, conversion rates, or annotations only meaningful inside the admin.
Filters the recurring price shown on My Account → Subscriptions before it is formatted with wc_price(). Receives the raw numeric total, not an HTML string.
> Naming note. The hook name contains a typo (recerring instead of recurring). Kept as-is to avoid breaking installations that already hook it. A future major release may introduce aswc_recurring_total_price_list_table as a clean alias and deprecate this one. Filters the formatted recurring total used in the admin subscriptions list, after it has already been processed by aswc_recerring_total_price_list_table_callback(). Last-mile hook before the value is inserted into the row.
Filters the line-total (and line-subtotal) of a cart item that participates in a plan switch, before the order line is written. Fired twice per item: once for total, once for subtotal.
Type: Action
Since: 1.0.0
Files:public/partials/templates/myaccount/aswc-show-subscription-details.php, public/partials/templates/myaccount/aswc-subscriptions.php, includes/aswc-common-functions.php, includes/loader/includes/aswc-loader-common-functions.php, several email templates. Fires inside My Account and email templates when the recurring total is about to be rendered. > Naming. The hook name contains the typo recerring (instead of recurring). It is kept verbatim to avoid breaking integrations that already depend on it. A correctly-spelled action aswc_display_subscription_recurring_total_account_page is fired in parallel from includes/aswc-common-functions.php since 1.0.0 — prefer the corrected name in new code, but be aware both fire.
Correctly-spelled twin of aswc_display_subscription_recerring_total_account_page. Both fire from the same call site so listeners can choose either name.
Type: Filter
Since: 1.0.0
Files:public/class-aswc-public.php, includes/loader/admin/class-aswc-loaderadmin.php Filters the "current time" used by the activation flow when computing subscription dates. Override to inject a fixed clock during testing. > Naming. Misspelled curent (instead of current). Kept for backwards compatibility.
Filters whether a billing period is "too short" to bother scheduling a heads-up notification (e.g. weekly subscriptions skip the 7-day reminder). Override to force-enable or force-disable the threshold.
Filters the list of subscription statuses that qualify for customer notifications. The default is [ 'active', 'pending-cancel' ] — add on-hold here to keep notifying customers whose subscription is on hold, for example.
Filters the array of admin settings tabs before the plugin's default tabs are appended. Use this to add a tab that should appear first in the navigation.
Last-mile filter for the tabs array. Anything added here appears at the end of the navigation. Use it to add an "About" or "License" tab that should always be the last one.
Filters the list of form fields that render on the General tab of the plugin's settings screen. Each field is an array describing type, id, label, options, etc., consistent with the plugin's internal form renderer.
Filters the schema array used to save the General tab. Different from aswc_add_general_settings_fields (which produces the render schema) in that this one is consumed by aswc_admin_save_tab_settings() to decide which keys to read from $_POST. Add a key here if you have added a field that the saver must persist.
Filters the field-definition array that renders the API tab. Use it to expose additional API-related options (extra secret keys, allowed origins, etc.).
Filters the field-definition array rendered above the Subscriptions table in the admin. Use it to add filtering controls or quick actions to the table view.
Filters the array of product editor tabs when the product is a subscription. The plugin adds a Subscription Settings tab; use this filter to add additional tabs alongside it.
Filters the CSS classes applied to the plugin's product-editor Subscription Settings tab. Use it to hide the tab for certain product types (the standard show_if_* class pattern) or to attach custom JS hooks.
Parámetro
Tipo
Descripción
`$classes`
array
Default array().
Devuelve:array.
PHP
add_filter( 'aswc_swf_settings_tabs_class', function( $classes ) {
// Only show on simple and variable products.
$classes[] = 'show_if_simple';
$classes[] = 'show_if_variable';
return $classes;
} );
WCFM (vendor dashboard) variant of aswc_save_simple_subscription_field. Fires when a vendor saves a subscription product through the WCFM frontend dashboard.
Filters the WCFM field-definitions array used to render the subscription product editor inside the WCFM vendor dashboard. Useful to add or remove vendor-side controls without touching WooCommerce admin.
Type: Filter
Since: 1.0.0
Files:advanced-subscriptions-for-woocommerce.php, admin/partials/class-aswc-admin-subscription-list.php, includes/loader/admin/class-aswc-loaderadmin.php Filters the list of subscription statuses (slug → label) used in admin UIs.
Type: Filter
Since: 1.0.0
Files:admin/partials/class-aswc-admin-subscription-list.php, includes/loader/admin/partials/class-aswc-loaderview-renewal-list.php Filters the bulk-action menu of the admin subscriptions list (and the Pro renewals list).
Filters each row of the admin subscriptions list table before it is rendered. Use to add (or rewrite) columns programmatically — the WCFM compatibility shim attaches to it to add a "Vendor" column on multi-vendor sites.
Parámetro
Tipo
Descripción
`$row`
array
Row data keyed by column name (subscription_id, parent_order_id, status, items, total, start_date, trial_end, next_payment_date, last_order_date, subscriptions_expiry_date, …)
Filters each row of the Subscriptions → Active report CSV export. Pairs with aswc_subs_csv_title to add new columns or rewrite values before they are written to disk.
Filters the args array passed to wc_register_order_type( 'aswc_subscriptions', ... ) when the plugin registers its custom order type on the init hook (priority 5). Override here to customise labels, capabilities, admin visibility, supports flags, and so on.
Parámetro
Tipo
Descripción
`$args`
array
Order-type registration args
Devuelve:array.
PHP
add_filter( 'aswc_register_custom_order_types', function( $args ) {
// Hide the post type from menus on a slim-admin install.
$args['show_in_menu'] = false;
$args['show_in_admin_bar'] = false;
return $args;
} );
Filters whether a given coupon type should be considered a gift-card coupon for the purposes of the WGM (Woo Gift Cards by Multiwebinc) compatibility shim.
Type: Filter
Since: 1.0.0
Files:includes/aswc-common-functions.php, includes/loader/includes/aswc-loader-common-functions.php Filters the screen-id list considered to be "plugin admin pages" (used for asset enqueueing).
Filters the arguments passed to the Action Scheduler when scheduling a subscription event. The default args include the subscription ID and a is_retry flag for retry events.
Parámetro
Tipo
Descripción
`$action_args`
array
Args array (will be [ 'subscription_id' => …, ...other ]).
Filters the priority at which a scheduled action is registered with Action Scheduler. Defaults to the value of the WP option advanced_subscriptions_woocommerce_scheduler_action_priority (or the class constant ACTION_PRIORITY if unset). Lower numbers fire earlier within the same timestamp.
Filters the resolved last order for a subscription. Depending on the $return_fields requested, it can be either a WC_Order object or an order ID. Returns false if no last order is found or if it has an excluded status.