Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Add wc_has_block_template filter to WooCommerce Core #4970

Closed
tjcafferkey opened this issue Oct 20, 2021 · 0 comments · Fixed by woocommerce/woocommerce#30997
Closed

Add wc_has_block_template filter to WooCommerce Core #4970

tjcafferkey opened this issue Oct 20, 2021 · 0 comments · Fixed by woocommerce/woocommerce#30997
Assignees
Labels
focus: FSE Work related to prepare WooCommerce for FSE. focus: template Related to API powering block template functionality in the Site Editor type: enhancement The issue is a request for an enhancement.

Comments

@tjcafferkey
Copy link
Contributor

Description

As described in #4939 we need to update the return value of the following function

From

return is_readable(
    get_stylesheet_directory() . '/block-templates/' . $template_name . '.html'
);

To

return apply_filters( 'wc_has_block_template',
    is_readable(
        get_stylesheet_directory() . '/block-templates/' . $template_name . '.html'
    )
);

This will allow us to override this value from Woo Blocks to serve the block templates from Woo Blocks.

Acceptance Criteria

This will just require some regression testing to make sure everything is working as expected still.

  • Given the same scenarios of rendering Block Templates over Legacy PHP Templates if they're available within the theme of a compatible Block Theme, everything should still work the same.
@tjcafferkey tjcafferkey added type: enhancement The issue is a request for an enhancement. focus: FSE Work related to prepare WooCommerce for FSE. focus: template Related to API powering block template functionality in the Site Editor labels Oct 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: FSE Work related to prepare WooCommerce for FSE. focus: template Related to API powering block template functionality in the Site Editor type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant