Search for Resources and Solutions

user_plan_subscription_expires

user_plan_subscription_expires is an important hook which can be used to execute code in the last 5 days of the user's subscription end. It is available since version 0.0.8.3.

How the user_plan_subscription_expires hook work? In the last 5 days of the plan's subscription period, the hook user_plan_subscription_expires will be called. The user_plan_subscription_expires hook is incomplete. It should have at the end (_2) which means 2 days. (_5) means 5 days until the subscription expires.

Example:

add_hook(

'user_plan_subscription_expires_2',

function ($args) {

// $args contains the user's ID and plan's ID

}

);

In this way by using the plugins, you can send custom notifications to your clients.

Was this article helpful?