Automattic\WooCommerce\Internal\CustomerEmailVerification
EmailVerificationService::get_account_email
The user's account email, lower-cased, or null when the user does not exist.
Lower-casing here is the single normalisation point, so the verified-status match and the key's email-binding hash stay consistent however the address was capitalised.
Method of the class: EmailVerificationService{}
No Hooks.
Returns
string|null.
Usage
// private - for code of main (parent) class only $result = $this->get_account_email( $user_id ): ?string;
- $user_id(int) (required)
- WordPress user ID.
EmailVerificationService::get_account_email() EmailVerificationService::get account email code WC 11.0.1
private function get_account_email( int $user_id ): ?string {
$user = get_user_by( 'id', $user_id );
return $user instanceof \WP_User ? strtolower( $user->user_email ) : null;
}