Check for woocommerce as the theme before rendering with a more user friendly plugin name (https://github.com/woocommerce/woocommerce-blocks/pull/5420)

This commit is contained in:
Tom Cafferkey 2021-12-20 14:36:26 +00:00 committed by GitHub
parent d8dac8bb0a
commit 13d151fe2a
1 changed files with 2 additions and 1 deletions

View File

@ -98,7 +98,7 @@ class BlockTemplateUtils {
$template = new \WP_Block_Template();
$template->wp_id = $post->ID;
$template->id = $theme . '//' . $post->post_name;
$template->theme = $theme;
$template->theme = 'woocommerce' === $theme ? 'WooCommerce' : $theme;
$template->content = $post->post_content;
$template->slug = $post->post_name;
$template->source = 'custom';
@ -109,6 +109,7 @@ class BlockTemplateUtils {
$template->has_theme_file = $has_theme_file;
$template->is_custom = false;
$template->post_types = array(); // Don't appear in any Edit Post template selector dropdown.
if ( 'wp_template_part' === $post->post_type ) {
$type_terms = get_the_terms( $post, 'wp_template_part_area' );
if ( ! is_wp_error( $type_terms ) && false !== $type_terms ) {