Automattic\WooCommerce\Internal\StockNotifications

Notification::is_verification_key_expired │ public │ WC 11.3.0

Check whether the stored verification key is past its expiration time.

A missing or malformed key is not reported as expired.

Метод класса: Notification{}

Хуков нет.

Возвращает

bool. True if a verification key is stored and has expired, false otherwise.

Использование

$Notification = new Notification();
$Notification->is_verification_key_expired(): bool;

Список изменений

С версии 11.3.0 Введена.

Код Notification::is_verification_key_expired() WC 11.3.0

public function is_verification_key_expired(): bool {
	$action_key = (string) $this->get_meta( 'verification_action_key' );

	if ( ! str_contains( $action_key, ':' ) ) {
		return false;
	}

	list( $timestamp ) = explode( ':', $action_key, 2 );

	return time() - (int) $timestamp > Config::get_verification_expiration_time_threshold();
}