benecaster_gdpr_retention_skip
Allows aborting the entire nightly GDPR retention cron sweep before it begins. Fires once at the start of the nightly retention cron job, before any users are evaluated or erased. Return true to abort the entire sweep — no users will be processed during this run. Does not affect manual single-user deletions triggered via the REST endpoint (those are controlled per-user by benecaster_gdpr_purge_skip).
Use this hook for maintenance windows, migration periods, or integration scenarios where automated erasure must be temporarily paused. The next scheduled cron run will fire this filter again — a true return only suppresses the current run.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$skip |
bool |
— | Whether to abort the sweep. Default false. |
$retention_days |
int |
— | The configured data retention window in days. |
Returns:
bool
Examples
Abort the sweep during site-wide maintenance mode
add_filter( 'benecaster_gdpr_retention_skip', function ( bool $skip, int $retention_days ): bool {
if ( get_option( 'my_plugin_maintenance_mode' ) ) {
return true;
}
return $skip;
}, 10, 2 );
Affects
- GDPR nightly retention cron
Need this built rather than just documented? See our services →