WordPress action hook

woocommerce_subscription_status_updated

Fired by 3 WordPress plugins, running on 1,020+ sites between them.

How to use woocommerce_subscription_status_updated

It's an action: your callback runs at that point and receives 3 arguments. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'woocommerce_subscription_status_updated', function( $arg1, $new_status, $previous_status ) {
	// Your code runs here.
}, 10, 3 );

Argument names come from Flexible Subscriptions's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

3 plugins that fire woocommerce_subscription_status_updated

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Flexible Subscriptions icon Flexible Subscriptions1,000+ installs do_action( 'woocommerce_subscription_status_updated', $this->caster->cast_to( WC_Subscription::class, $subscription ), $new_status, $previous_status ) src/HookProvider/Compatibility/StatusHookMapper.php:42
  2. YeeSubscriptions icon YeeSubscriptions10+ installs do_action( 'woocommerce_subscription_status_updated', $subscription, $clean_to, $clean_from ) includes/class-yeekit-subscriptions-integration-handler.php:139
  3. Subscriptions & Recurring Payments for WooCommerce icon Subscriptions & Recurring Payments for WooCommerce10+ installs do_action( 'woocommerce_subscription_status_updated', $this, $status_transition['to'], $status_transition['from'] ) inc/classes/class-awc-subscription.php:570

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.