Support

Account

Forum Replies Created

  • I found the hook. This worked for me, if anyone is also having issues with links or gutenberg blocks in the WooCommerce checkout terms and conditions checkbox field:

    /**
     * Replace wc_terms_and_conditions_page_content to apply the_content filter to markup
     */
    function my_wc_terms_and_conditions_page_content() {
    	$terms_page_id = wc_terms_and_conditions_page_id();
    
    	if ( ! $terms_page_id ) {
    		return;
    	}
    
    	$page = get_post( $terms_page_id );
    
    	if ( $page && 'publish' === $page->post_status && $page->post_content && ! has_shortcode( $page->post_content, 'woocommerce_checkout' ) ) {
    		//echo '<div class="woocommerce-terms-and-conditions" style="display: none; max-height: 200px; overflow: auto;">' . wc_format_content( wp_kses_post( $page->post_content ) ) . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    		echo '<div class="woocommerce-terms-and-conditions" style="display: none; max-height: 200px; overflow: auto;">' . apply_filters( 'the_content', $page->post_content ) . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    	}
    }
    remove_action( 'woocommerce_checkout_terms_and_conditions', 'wc_terms_and_conditions_page_content', 30 );
    add_action( 'woocommerce_checkout_terms_and_conditions', 'my_wc_terms_and_conditions_page_content', 30 );
  • I’m having the same issue. In my case, in addition to links in the WYSIWYG fields, ACF Gutenberg blocks are also getting mangled. My guess is that there’s a WC hook that would allow us to change the function from wp_kses to apply_filters( ‘the_content’… Just need to figure out where it lives.

  • I am experiencing the same on two websites. Yes, as Vayu said, it does look like it’s <header> tags are indeed breaking the json when I view the response in the network developer tools.

  • Having the same issue. I’ve checked multiple users on our site. All but one user displays the field groups as expected. The user profile that doesn’t display them is an administrator, as are other users I’ve checked that worked successfully.

Viewing 4 posts - 1 through 4 (of 4 total)