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

Make it so WooCommerce template names are not editable #5385

Merged
merged 2 commits 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
5 changes: 2 additions & 3 deletions src/Utils/BlockTemplateUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
$type_terms = get_the_terms( $post, 'wp_template_part_area' );
Expand Down Expand Up @@ -140,14 +140,13 @@ public static function gutenberg_build_template_result_from_file( $template_file
$template->id = 'woocommerce//' . $template_file->slug;
$template->theme = 'woocommerce/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.
$template->area = 'uncategorized';
return $template;
Expand Down