Automattic\WooCommerce\Internal\CustomerEmailVerification
EmailVerificationService::has_pending_key
Whether the user currently has a pending (minted, unexpired) verification key awaiting use.
Used to decide whether the My Account prompt shows the "check your inbox" notice or the "send a confirmation link" call to action.
Method of the class: EmailVerificationService{}
No Hooks.
Returns
bool.
Usage
$EmailVerificationService = new EmailVerificationService(); $EmailVerificationService->has_pending_key( $user_id ): bool;
- $user_id(int) (required)
- WordPress user ID.
Changelog
| Since 11.0.0 | Introduced. |
EmailVerificationService::has_pending_key() EmailVerificationService::has pending key code WC 11.0.1
public function has_pending_key( int $user_id ): bool {
$parsed = $this->parse_stored_key( $user_id );
return null !== $parsed && time() - $parsed[0] <= self::KEY_TTL;
}