From 987b6d6afae0c3534b479a71b72d7b7be379fc30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Mon, 20 Dec 2021 11:46:41 +0100 Subject: [PATCH] Make it so WooCommerce template names are not editable (#5385) * Make it so WooCommerce template names is not editable * Remove source='plugin' from templates --- src/Utils/BlockTemplateUtils.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Utils/BlockTemplateUtils.php b/src/Utils/BlockTemplateUtils.php index dbfa5c20976..1b3e425959a 100644 --- a/src/Utils/BlockTemplateUtils.php +++ b/src/Utils/BlockTemplateUtils.php @@ -107,7 +107,7 @@ public static function gutenberg_build_template_result_from_post( $post ) { $template->title = $post->post_title; $template->status = $post->post_status; $template->has_theme_file = $has_theme_file; - $template->is_custom = true; + $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 ) { @@ -136,14 +136,13 @@ public static function gutenberg_build_template_result_from_file( $template_file $template->id = 'woocommerce//' . $template_file->slug; $template->theme = 'WooCommerce'; $template->content = self::gutenberg_inject_theme_attribute_in_content( $template_content ); - $template->source = 'plugin'; $template->slug = $template_file->slug; $template->type = $template_type; $template->title = ! empty( $template_file->title ) ? $template_file->title : self::convert_slug_to_title( $template_file->slug ); $template->status = 'publish'; $template->has_theme_file = true; $template->origin = 'plugin'; - $template->is_custom = false; // Templates loaded from the filesystem aren't custom, ones that have been edited and loaded from the DB are. + $template->is_custom = false; $template->post_types = array(); // Don't appear in any Edit Post template selector dropdown. if ( 'wp_template_part' === $template_type ) { if ( 'mini-cart' === $template_file->slug ) {