From 3cf50c60f6f2c4537fcd1c0c58d1f4ac87406027 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 10 Apr 2017 21:18:49 +0100 Subject: [PATCH] Fix backwards compat logic in enable_guest_checkout Fixes #14211 --- includes/class-wc-checkout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index f404d892f4e..654d7215a28 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -91,7 +91,7 @@ class WC_Checkout { case 'enable_guest_checkout' : $bool_value = wc_string_to_bool( $value ); - if ( $bool_value !== $this->is_registration_required() ) { + if ( $bool_value === $this->is_registration_required() ) { remove_filter( 'woocommerce_checkout_registration_required', '__return_true', 0 ); remove_filter( 'woocommerce_checkout_registration_required', '__return_false', 0 ); add_filter( 'woocommerce_checkout_registration_required', $bool_value ? '__return_false' : '__return_true', 0 );