From 498fdfb97f7acf1666fe95f70b6c065de87ab836 Mon Sep 17 00:00:00 2001 From: vendidero Date: Tue, 24 Oct 2023 13:04:34 +0200 Subject: [PATCH] Added filter to disable block checkout adjustments. --- src/Blocks/Checkout.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Blocks/Checkout.php b/src/Blocks/Checkout.php index 3046ab8da..45ebbd033 100644 --- a/src/Blocks/Checkout.php +++ b/src/Blocks/Checkout.php @@ -84,7 +84,14 @@ private function adjust_checkout_block() { add_filter( 'render_block', function( $content, $block ) { - if ( 'woocommerce/checkout' === $block['blockName'] ) { + /** + * Whether to disable the (structural) adjustments applied to the WooCommerce checkout block. + * + * @param boolean Whether to disable the checkout adjustments or not. + * + * @since 3.14.0 + */ + if ( 'woocommerce/checkout' === $block['blockName'] && ! apply_filters( 'woocommerce_gzd_disable_checkout_block_adjustments', false ) ) { $content = str_replace( 'wp-block-woocommerce-checkout ', 'wp-block-woocommerce-checkout wc-gzd-checkout ', $content ); if ( '' === substr( $content, -12 ) ) {