Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the prefix for custom templates #30467

Merged
Merged
Show file tree
Hide file tree
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
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?
aristath marked this conversation as resolved.
Show resolved Hide resolved
$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