Developer Hooks
This page documents key developer hooks for the Divi Membership subscription lifecycle. Use them to run custom code when subscriptions are created, renewed, cancelled, or refunded—useful for custom payment gateways or business logic.
Subscription actions
The first argument on lifecycle actions is the local dmem_subscription post ID.
| Event | Action | Additional arguments |
|---|---|---|
| Created | dmem_subscription_created | — |
| Renewed or retried successfully | dmem_subscription_renewed | — |
| Cancelled | dmem_subscription_cancelled | — |
| Refunded | dmem_subscription_refunded | — |
| Modified at the gateway | dmem_subscription_modified | New plan ID, new cycle key, updated gateway subscription |
| Plan changed locally | dmem_subscription_plan_changed | Old plan ID/key, new plan ID/key, customer ID |
| Reactivated by an administrator | dmem_subscription_admin_reactivated | Customer ID |
add_action( 'dmem_subscription_renewed', function ( $subscription_id ) {
// Queue your integration work. Avoid slow remote calls in the payment request.
}, 10, 1 );
The same broad event can originate from Stripe, PayPal, WooCommerce, Bulk Assign, an offline payment, or an administrator action. Read the subscription's current status and payment method instead of assuming one gateway or payload shape.
Trial actions
| Event | Action | Additional arguments |
|---|---|---|
| Trial started | dmem_trial_started | Trial end timestamp/date |
| Ending soon | dmem_trial_ending_soon | Trial end date |
| Converted to paid | dmem_trial_converted | — |
| Grace period started | dmem_trial_grace_period_started | Grace end date |
| Trial expired | dmem_trial_expired | — |
Offline payment actions
dmem_offline_payment_pending, dmem_offline_payment_completed, and dmem_offline_payment_rejected each receive the local subscription post ID. They correspond to bank-transfer creation, Mark as paid, and Reject payment.
Useful filters
| Purpose | Filter |
|---|---|
| Decide trial eligibility | divi_membership_trial_eligible |
| Days before the ending-soon event | dmem_trial_ending_soon_days |
| Trial grace-period length | dmem_trial_grace_period_days |
| Grant access without a subscription | divi_membership_grant_access_without_subscription |
| Statuses that grant content access | divi_membership_access_granting_subscription_statuses |
| Whether restricted module content is shown | divi_membership_show_restricted_content |
| Additional Divi Nitro cache exclusions | dmem_nitro_exclude_paths |
| Membership billing-cycle, member, content-access, and feature data | divi_membership_billing_cycle_data, divi_membership_member_data, divi_membership_content_access_data, divi_membership_feature_data |
Check the hook call in the installed plugin version before setting accepted_args. Some filters receive contextual values after the value being filtered—for example, trial eligibility also receives user, plan, email, and mode—while data filters receive a plan ID. Return the same data type the filter received.
What's Next
- Zapier integration — Webhooks and filters for subscription data sent to Zapier.
- Subscription management — Admin actions and member account behaviour.
- Resources — Changelog, support, and other links.