• Resolved webfolk

    (@webfolk)


    Was looking to test something for compatibility-purposes and found that I was unable to get the following (or any) remove_action to work on the single product template.

    functions.php:

    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );

    Theme: Twenty Twenty Two
    WordPress Core: 6.3.2
    Plugins Installed: WooCommerce v8.2.1

    Has something changed/was hook support dropped for block themes? Looking at the template, the hooks are identical, but maybe I am missing something. Just wondering how templates are supposed to be customized in Twenty Twenty Two.

    Note: This was purely for demo/testing purposes to test functionality of something. I do not nor would I ever add code directly to a default theme.

Viewing 1 replies (of 1 total)
  • Saif

    (@babylon1999)

    Hello @webfolk,

    Thank you for reaching out!

    Was looking to test something for compatibility-purposes and found that I was unable to get the following (or any) remove_action to work on the single product template.

    The hook isn’t removed with block-based themes. I assume what’s happening here is that your single product template is composed of single product blocks, similar to this:


    Link to image: https://d.pr/i/Ww9iAQ

    If that’s the case, then yes, the filter hook won’t work because these blocks operate differently than WooCommerce default templates. :?)

    To achieve the same result, you can simply remove the “Product Details” block.

    If you prefer using a block-based theme but still want to customize with hooks, you can replace all these blocks with the following one, which will use the default templates:


    Link to image: https://d.pr/i/s0xJGr

    Hope this helps, let us know if you have any other questions! :?)

Viewing 1 replies (of 1 total)
  • The topic ‘remove_action() not working in twentytwentytwo’ is closed to new replies.