# double-opt-in/5.5.0/src/Events/Lifecycle/OptInExpiredEvent.php

Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification, version 5.5.0. 68 lines.

- Page: https://pluginprobe.com/plugins/double-opt-in/5.5.0/code/src/Events/Lifecycle/OptInExpiredEvent.php
- Raw: https://pluginprobe.com/plugins/double-opt-in/5.5.0/raw/src/Events/Lifecycle/OptInExpiredEvent.php
- Modified: 2026-07-13T09:16:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/double-opt-in/5.5.0/code/src/Events/Lifecycle/OptInExpiredEvent.php#L10-L20`.

```php
<?php
/**
 * OptIn Expired Event
 *
 * @package Forge12\DoubleOptIn\Events\Lifecycle
 * @since   4.0.0
 */

namespace Forge12\DoubleOptIn\Events\Lifecycle;

use Forge12\DoubleOptIn\EventSystem\Event;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class OptInExpiredEvent
 *
 * @api
 *
 * Dispatched when opt-in records are cleaned up by the cron job.
 * Covered by the Addon API semver policy as of Core API 4.3.0.
 */
class OptInExpiredEvent extends Event {

	private string $cleanupType;
	private int $rowsDeleted;
	private \DateTimeImmutable $threshold;

	/**
	 * Constructor.
	 *
	 * @param string             $cleanupType  The type: 'confirmed' or 'unconfirmed'.
	 * @param int                $rowsDeleted  Number of records deleted.
	 * @param \DateTimeImmutable $threshold    The cutoff date/time.
	 */
	public function __construct(
		string $cleanupType,
		int $rowsDeleted,
		\DateTimeImmutable $threshold
	) {
		parent::__construct();
		$this->cleanupType = $cleanupType;
		$this->rowsDeleted = $rowsDeleted;
		$this->threshold   = $threshold;
	}

	/**
	 * {@inheritdoc}
	 */
	public static function getWordPressHookName(): string {
		return 'f12_cf7_doubleoptin_expired';
	}

	public function getCleanupType(): string {
		return $this->cleanupType;
	}

	public function getRowsDeleted(): int {
		return $this->rowsDeleted;
	}

	public function getThreshold(): \DateTimeImmutable {
		return $this->threshold;
	}
}

```
