Developers - Action & Filter Reference

Subscriptio - WooCommerce Subscriptions comes with action & filter hooks that allow developers to extend its functionality. Below is a list of available actions and filters.

 

Action: subscriptio_subscription_save_meta

Gives the ability to add subscription meta-data when creating a new single product subscription from one order item (not multi-product subscription)

Parameters: 

$subscription object Subscription object
$order object WooCommerce order object
$order_meta array Order meta data
$order_item_id integer Order item's id
$order_item array Data of order item
$product object WooCommerce product object
$product_meta array Product's meta-data
$renewal array Renewal properties data

 

Action: subscriptio_multisubscription_save_meta

Gives the ability to add subscription meta-data when creating a new multi-product subscription from one order item

Parameters: 

$subscription object Subscription object
$order object WooCommerce order object
$order_meta array Order meta data
$all_subs array All subscription's products data
$renewal array Renewal properties data

 

Action: subscriptio_payment_applied

Fired after the payment is registered for subscription.

Parameters: 

$subscription_id integer ID of Subscription
$order_id integer ID of WooCommerce Order

 

 

Actions: subscriptio_status_changing | subscriptio_status_changed

Actions firing before and after subscription status change

Parameters: 

$subscription_id integer ID of Subscription
$old_status string Old status of the Subscription
$new_status string New status of the Subscription

 

Actions: subscriptio_status_changing_to_NEWSTATUS | subscriptio_status_changed_to_NEWSTATUS

Fired when status is changing/changed to 'NEWSTATUS'

Parameters: 

$subscription_id integer ID of the subscription
$old_status string Old status of the Subscription

 

Actions: subscriptio_status_changing_from_OLDSTATUS_to_NEWSTATUS | subscriptio_status_changed_from_OLDSTATUS_to_NEWSTATUS

Fired when status is changing/changed from 'OLDSTATUS' to 'NEWSTATUS'.

Parameters: 

$subscription_id integer ID of the subscription

 

Actions: subscriptio_membership_activate | subscriptio_membership_deactivate

Fires on activation or deactivation of a membership

Parameters: 

$subscription->user_id integer User ID of the Subscription
$subscription->membership_ids array User ID's of the Membership

 

Filter: subscriptio_capability

Capabilities used for different actions

Parameters: 

$capability1, $capability2 string Two capability strings

 

Filter: subscriptio_site_url

To override main site URL

Parameters: 

$main_site_url string Site's URL

 

Filter: subscriptio_is_main_site

Checks whether it's main site or not

Parameters: 

$is_main_site boolean Last moment to change the value

 

Filter: subscriptio_subscription_time_units

Time units array

Parameters: 

array Time units calculated in seconds

 

Filter: subscriptio_third_party_meta_boxes_to_leave

Selects which third party meta boxes to leave on custom Subscriptio post types pages (all of them will be removed by default)

Parameters: 

array
The names of meta-boxes (empty by default)

 

Filter: subscriptio_subscription_properties_to_populate

Properties to populate at the creation of new subscription

Parameters: 

array
Array of fields

 

Filter: subscriptio_subscription_fields_to_update

Properties to update in subscription object

Parameters: 

array
Array of fields 

 

 

 

 

 

 

Have more questions? Submit a request