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

Commit

Permalink
Make it so WooCommerce template names are not editable (#5385)
Browse files Browse the repository at this point in the history
* Make it so WooCommerce template names is not editable

* Remove source='plugin' from templates
  • Loading branch information
Aljullu authored Dec 20, 2021
1 parent 1f8bdb1 commit 71558e2
Showing 1 changed file with 2 additions and 3 deletions.
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 @@ -139,14 +139,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.
$template->area = 'uncategorized';
return $template;
Expand Down

0 comments on commit 71558e2

Please sign in to comment.