Skip to content

Commit

Permalink
Change the prefix for custom templates (#30467)
Browse files Browse the repository at this point in the history
* Change the prefix for custom templates

* Update comment
  • Loading branch information
aristath authored Apr 2, 2021
1 parent 91b24b6 commit 5e58e00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/full-site-editing/template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ function gutenberg_override_query_template( $template, $type, array $templates =
$template_item_slug = gutenberg_strip_php_suffix( $template_item );

// Is this a custom template?
$is_custom_template = 0 === strpos( $current_block_template_slug, 'custom-template-' );
// This check should be removed when merged in core.
// Instead, wp_templates should be considered valid in locate_template.
$is_custom_template = 0 === strpos( $current_block_template_slug, 'wp-custom-template-' );

// Don't override the template if we find a template matching the slug we look for
// and which does not match a block template slug.
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-post/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ export function* __unstableSwitchToEditingMode( shouldCreateTemplate = false ) {
createBlock( 'core/post-content' ),
];
const template = {
slug: 'custom-template-' + uuid(),
slug: 'wp-custom-template-' + uuid(),
content: serialize( templateContent ),
title: 'Custom Template',
};
Expand Down

0 comments on commit 5e58e00

Please sign in to comment.