WC_Shortcode_Checkout::guest_should_verify_emailprivate staticWC 1.0

Tries to determine if the user's email address should be verified before rendering either the 'order received' or 'order pay' pages. This should only be applied to guest orders.

Method of the class: WC_Shortcode_Checkout{}

No Hooks.

Returns

true|false.

Usage

$result = WC_Shortcode_Checkout::guest_should_verify_email( $order, $context ): bool;
$order(WC_Order) (required)
The order for which a need for email verification is being determined.
$context(string) (required)
The context in which email verification is being tested.

WC_Shortcode_Checkout::guest_should_verify_email() code WC 10.7.0

private static function guest_should_verify_email( WC_Order $order, string $context ): bool {
	// If we cannot match the order with the current user, ask that they verify their email address.
	$nonce_is_valid = wp_verify_nonce( filter_input( INPUT_POST, 'check_submission' ), 'wc_verify_email' );
	$supplied_email = null;
	$order_id       = $order->get_id();

	if ( $nonce_is_valid ) {
		$supplied_email = sanitize_email( wp_unslash( filter_input( INPUT_POST, 'email' ) ) );
	}

	return Users::should_user_verify_order_email( $order_id, $supplied_email, $context );
}