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

Commit

Permalink
Fix syntax error from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
opr committed Nov 3, 2021
1 parent 495f4d2 commit 3cc5e67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/BlockTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ public function add_block_templates( $query_result, $query, $template_type ) {

// @todo: Add apply_filters to _gutenberg_get_template_files() in Gutenberg to prevent duplication of logic.
foreach ( $template_files as $template_file ) {
// It would be custom if the template was modified in the editor, so if it's not custom we can load it from

// It would be custom if the template was modified in the editor, so if it's not custom we can load it from
// the filesystem.
if ( $post_type && 'custom' !== $template_file->source ) {
$query_result[] = BlockTemplateUtils::gutenberg_build_template_result_from_file( $template_file, 'wp_template' );
continue;
}

$template = BlockTemplateUtils::gutenberg_build_template_result_from_file( $template_file, 'wp_template' );

if ( $post_type &&
Expand All @@ -179,7 +179,6 @@ public function add_block_templates( $query_result, $query, $template_type ) {
if ( $should_include ) {
$query_result[] = $template;
}

}

return $query_result;
Expand Down Expand Up @@ -241,8 +240,8 @@ function ( $template ) use ( $template_slug ) {
// At this point the template only exists in the Blocks filesystem and has not been saved in the DB,
// or superseded by the theme.
$new_template_item = array(
'slug'. => $template_slug,
'path'. => $template_file,
'slug' => $template_slug,
'path' => $template_file,
'type' => 'wp_template',
'theme' => 'woocommerce',
'description' => '',
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/BlockTemplateUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public static function gutenberg_build_template_result_from_file( $template_file
$template->status = 'publish';
$template->has_theme_file = true;
$template->is_custom = false; // Templates loaded from the filesystem aren't custom, ones that have been edited and loaded from the DB are.
$template->title = self::convert_slug_to_title( $template_file['slug'] );
$template->title = self::convert_slug_to_title( $template_file->slug );
return $template;
}

Expand Down

0 comments on commit 3cc5e67

Please sign in to comment.