Automattic\WooCommerce\Internal\CustomerEmailVerification
EmailVerificationService::is_verified
Return whether the given user has verified their current account email address.
A user is verified only while the stored verified email matches their current account email, so changing the account email automatically invalidates the status — no change event needs to be observed.
Method of the class: EmailVerificationService{}
No Hooks.
Returns
bool. True when the stored verified email matches the user's current email.
Usage
$EmailVerificationService = new EmailVerificationService(); $EmailVerificationService->is_verified( $user_id ): bool;
- $user_id(int) (required)
- WordPress user ID.
Changelog
| Since 11.0.0 | Introduced. |
EmailVerificationService::is_verified() EmailVerificationService::is verified code WC 11.0.1
public function is_verified( int $user_id ): bool {
$verified_email = (string) Users::get_site_user_meta( $user_id, self::VERIFIED_META );
// Both sides are lower-cased (stored that way, get_account_email() normalises), so === is exact.
return '' !== $verified_email && $verified_email === $this->get_account_email( $user_id );
}