benecaster_promote_grace_length_days
Varies the grace-period length, in days, for one transferred subscriber at the moment it is set — so the length can depend on tier, billing interval or the individual subscriber rather than being the single number the Promote to Bridge wizard collected. Runs once per transferred row during the promotion run.
Returning 0 does not mean “no grace period”. The value is floored to one day after the callback returns, deliberately: a zero would write a deadline in the past and the daily expiry cron would revoke that subscriber on its very next tick — cutting off the person being migrated. If someone should not get a grace period, do not promote them.
It applies to the initial set only, never to Extend. The number typed into the Promotion History panel is used as typed; filtering it would make the panel report a change it did not make.
The wizard’s result payload reports the baseline, not the outcome. grace_period_ends_at in the run response is calculated from the number the podcaster typed, so with this filter in play individual rows will differ from it. Read promote_grace_period_ends_at per row instead.
The return is cast with (int), so a numeric string works, and a non-numeric return silently becomes 0 — which the floor described above then lifts to one day rather than erroring.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$days |
int |
— | The wizard's `grace_days` value, already floored to 1. |
$promotion |
array |
— | The subscription row being transferred. |
$user_id |
int |
— | Subscriber's WordPress user ID. Also present in `$promotion`. |
Returns:
int
Need this built rather than just documented? See our services →