Skip to content

Commit

Permalink
Added filter to disable block checkout adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisnissle committed Oct 24, 2023
1 parent b113e5d commit 498fdfb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Blocks/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ( '</div></div>' === substr( $content, -12 ) ) {
Expand Down

0 comments on commit 498fdfb

Please sign in to comment.