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.
Метод класса: EmailVerificationService{}
Хуков нет.
Возвращает
bool. True when the stored verified email matches the user's current email.
Использование
$EmailVerificationService = new EmailVerificationService(); $EmailVerificationService->is_verified( $user_id ): bool;
- $user_id(int) (обязательный)
- WordPress user ID.
Список изменений
| С версии 11.0.0 | Введена. |
Код EmailVerificationService::is_verified() EmailVerificationService::is verified WC 11.2.2
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 );
}