Skip to content

Default page and single post templates can be renamed in the template editor #40876

Closed

Description

@carolinan

Description

I am not sure if this is a bug, but it was unexpected for me.

While testing #40830, I noticed that if I activate a block theme that does not have a singular, post or page template, and I use the Site editor to create a page or a single template, then those templates can be renamed in the template editor.
(They can not be renamed when opened in the site editor.)

To clarify, these page templates are not custom page templates created via Block editor > Templates > New, and assigned to specific posts or pages, these are the default templates. The page (and soon , post) page template are the only default templates that can be renamed this way, since they are the only default templates that can be edited in the template editor.

Step-by-step reproduction instructions

  1. Activate a block theme that does not have a template for pages. For example https://wordpress.org/themes/miniblock-ooak/
  2. Open the Site Editor, template list, and select "Add new" and then "page".
  3. Create a new page in the block editor.
  4. Confirm that the default template is the page template you just created and not "index"
  5. Select the Edit link in the Template section to open the template editor
  6. Click on the template name at the top center above the content area to open the template options modal.
  7. Change the template name in the input, and select Update (save).

Optionally create a second, new page and see that the renamed template is used as the default.

Screenshots, screen recording, code snippet

No response

Environment info

Gutenberg current trunk or 13.1.0, WordPress 6.0 Rc1.
Beta tester plugin

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

No

Activity

  1. added
    [Type] FeedbackIssues that relate purely to feedback on a feature that isn't necessarily actionable
    on May 6, 2022
  2. Mamaduka commented on May 6, 2022

    @Mamaduka
    Member

    This is a bug. Changing template name for built-in template should be disabled.

    I will create PR shortly.

  3. added
    [Type] BugAn existing feature does not function as intended
    and removed
    [Type] FeedbackIssues that relate purely to feedback on a feature that isn't necessarily actionable
    on May 6, 2022
  4. self-assigned this
    on May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Feature] Template Editing ModeRelated to the template editor available in the Block Editor[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions