Skip to content

Conversation

@ellatrix
Copy link
Member

What?

Closes #72475.

Why?

Registered templates cannot be trashed or edited.

How?

These templates have a string ID, so we can check the type of the ID.

Testing Instructions

Click "Edit Site" on the front-end. When landing in the template editor, no actions should be available from the three-dot menu in the document panel.

Testing Instructions for Keyboard

Screenshots or screencast

Before After

@ellatrix ellatrix requested a review from Aljullu October 29, 2025 15:38
@github-actions
Copy link

github-actions bot commented Oct 29, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ellatrix <[email protected]>
Co-authored-by: Aljullu <[email protected]>
Co-authored-by: ntsekouras <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ellatrix ellatrix added [Type] Bug An existing feature does not function as intended Backport to WP 6.9 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) labels Oct 29, 2025
Copy link
Contributor

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working as expected for me, plugin-registered templates can't be sent to the trash anymore as the Actions button is not clickable:

Before After
Image Image

Thanks for looking into this, @ellatrix! 🙌

@ellatrix ellatrix merged commit 31afd06 into trunk Oct 30, 2025
43 checks passed
@ellatrix ellatrix deleted the fix/registered-template-trash branch October 30, 2025 11:16
@github-actions github-actions bot added this to the Gutenberg 22.1 milestone Oct 30, 2025
@ellatrix
Copy link
Member Author

Thanks @Aljullu!

@github-actions github-actions bot added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 6.9 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Oct 30, 2025
gutenbergplugin pushed a commit that referenced this pull request Oct 30, 2025
@github-actions
Copy link

I just cherry-picked this PR to the wp/6.9 branch to get it included in the next release: c3e7828

@mcsf mcsf changed the title Template activation: non-database templates cannot be trashed/edited Template activation: disallow editing/trashing of non-database templates Nov 3, 2025
@mcsf
Copy link
Contributor

mcsf commented Nov 3, 2025

(nice follow-up; edited PR title for clarity)

cbravobernal pushed a commit that referenced this pull request Nov 5, 2025
@cbravobernal
Copy link
Contributor

I just cherry-picked this PR to the release/22.0 branch to get it included in the next release: d7dd0a2

@cbravobernal cbravobernal removed the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Nov 5, 2025
ellatrix added a commit that referenced this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Template activation bugs with plugin-registered templates

5 participants