Replace instances of wp_is_block_theme() with wc_current_theme_is_fse_theme() (https://github.com/woocommerce/woocommerce-blocks/pull/6590)

This commit is contained in:
Albert Juhé Lluveras 2022-06-17 14:51:04 +02:00 committed by GitHub
parent 27224fd46e
commit b543fa2684
3 changed files with 3 additions and 4 deletions

View File

@ -199,8 +199,7 @@ class MiniCart extends AbstractBlock {
if (
current_user_can( 'edit_theme_options' ) &&
function_exists( 'wp_is_block_theme' ) &&
wp_is_block_theme()
wc_current_theme_is_fse_theme()
) {
$theme_slug = BlockTemplateUtils::theme_has_template_part( 'mini-cart' ) ? wp_get_theme()->get_stylesheet() : BlockTemplateUtils::PLUGIN_SLUG;
$site_editor_uri = admin_url( 'site-editor.php' );

View File

@ -33,7 +33,7 @@ class ProductSearchResultsTemplate {
* @param array $templates Templates that match the search hierarchy.
*/
public function update_search_template_hierarchy( $templates ) {
if ( ( is_search() && is_post_type_archive( 'product' ) ) && wp_is_block_theme() ) {
if ( ( is_search() && is_post_type_archive( 'product' ) ) && wc_current_theme_is_fse_theme() ) {
return [ self::SLUG ];
}
return $templates;

View File

@ -366,7 +366,7 @@ class BlockTemplateUtils {
*/
public static function supports_block_templates() {
if (
( ! function_exists( 'wp_is_block_theme' ) || ! wp_is_block_theme() ) &&
! wc_current_theme_is_fse_theme() &&
( ! function_exists( 'gutenberg_supports_block_templates' ) || ! gutenberg_supports_block_templates() )
) {
return false;