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

Fix modified block templates to have a user friendly Plugin name. #5420

Merged
merged 1 commit into from
Dec 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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