diff --git a/src/Utils/BlockTemplateUtils.php b/src/Utils/BlockTemplateUtils.php index bf8ddebbe6d..8b2e8eb4b6e 100644 --- a/src/Utils/BlockTemplateUtils.php +++ b/src/Utils/BlockTemplateUtils.php @@ -116,6 +116,11 @@ public static function gutenberg_build_template_result_from_post( $post ) { } } + if ( 'woocommerce' === $theme ) { + $template->theme = 'woocommerce/woocommerce'; + $template->origin = 'plugin'; + } + return $template; } @@ -133,7 +138,7 @@ public static function gutenberg_build_template_result_from_file( $template_file $template_content = file_get_contents( $template_file->path ); $template = new \WP_Block_Template(); $template->id = 'woocommerce//' . $template_file->slug; - $template->theme = 'WooCommerce'; + $template->theme = 'woocommerce/woocommerce'; $template->content = self::gutenberg_inject_theme_attribute_in_content( $template_content ); $template->source = 'plugin'; $template->slug = $template_file->slug;