Skip to main content

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.

EventActionAdditional arguments
Createddmem_subscription_created—
Renewed or retried successfullydmem_subscription_renewed—
Cancelleddmem_subscription_cancelled—
Refundeddmem_subscription_refunded—
Modified at the gatewaydmem_subscription_modifiedNew plan ID, new cycle key, updated gateway subscription
Plan changed locallydmem_subscription_plan_changedOld plan ID/key, new plan ID/key, customer ID
Reactivated by an administratordmem_subscription_admin_reactivatedCustomer ID
Example: respond to a renewal
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​

EventActionAdditional arguments
Trial starteddmem_trial_startedTrial end timestamp/date
Ending soondmem_trial_ending_soonTrial end date
Converted to paiddmem_trial_converted—
Grace period starteddmem_trial_grace_period_startedGrace end date
Trial expireddmem_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​

PurposeFilter
Decide trial eligibilitydivi_membership_trial_eligible
Days before the ending-soon eventdmem_trial_ending_soon_days
Trial grace-period lengthdmem_trial_grace_period_days
Grant access without a subscriptiondivi_membership_grant_access_without_subscription
Statuses that grant content accessdivi_membership_access_granting_subscription_statuses
Whether restricted module content is showndivi_membership_show_restricted_content
Additional Divi Nitro cache exclusionsdmem_nitro_exclude_paths
Membership billing-cycle, member, content-access, and feature datadivi_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​