WC_Shortcode_Checkout::guest_should_verify_email()private 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.

Метод класса: WC_Shortcode_Checkout{}

Хуков нет.

Возвращает

true|false.

Использование

$result = WC_Shortcode_Checkout::guest_should_verify_email( $order, $context ): bool;
$order(WC_Order) (обязательный)
The order for which a need for email verification is being determined.
$context(строка) (обязательный)
The context in which email verification is being tested.

Код WC_Shortcode_Checkout::guest_should_verify_email() WC 9.8.1

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 );
}