From c05c5d75cbe5f3f5d8c14ca36a87ce15fb3114f4 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 22 May 2018 14:10:09 +0100 Subject: [PATCH] No need to check if terms page is set if the field was posted. --- 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 82ed07bf222..dc150bf9981 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -736,7 +736,7 @@ class WC_Checkout { $this->validate_posted_data( $data, $errors ); $this->check_cart_items(); - if ( empty( $data['woocommerce_checkout_update_totals'] ) && ! empty( $_POST['terms-field'] ) && empty( $data['terms'] ) && apply_filters( 'woocommerce_checkout_show_terms', wc_get_page_id( 'terms' ) > 0 ) ) { // WPCS: input var ok, CSRF ok. + if ( empty( $data['woocommerce_checkout_update_totals'] ) && empty( $data['terms'] ) && ! empty( $_POST['terms-field'] ) ) { // WPCS: input var ok, CSRF ok. $errors->add( 'terms', __( 'Please read and accept the terms and conditions to proceed with your order.', 'woocommerce' ) ); }