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

Commit

Permalink
Check for woocommerce as the theme before rendering with a more user …
Browse files Browse the repository at this point in the history
…friendly plugin name (#5420)
  • Loading branch information
tjcafferkey authored Dec 20, 2021
1 parent bb975c6 commit f5521cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Utils/BlockTemplateUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function gutenberg_build_template_result_from_post( $post ) {
$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';
Expand All @@ -109,6 +109,7 @@ public static function gutenberg_build_template_result_from_post( $post ) {
$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 ) {
Expand Down

0 comments on commit f5521cf

Please sign in to comment.