Template field: match exactly the behavior of post template panel#76596
Template field: match exactly the behavior of post template panel#76596ntsekouras merged 1 commit intotrunkfrom
Conversation
|
Size Change: +94 B (0%) Total Size: 8.75 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 1e7ea81. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23207419091
|
t-hamano
left a comment
There was a problem hiding this comment.
LGTM! Happy to see the logic is consolidated.
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Mamaduka
left a comment
There was a problem hiding this comment.
The extracted logic looks good, and I just finished some smoke testing with the provided steps. I couldn't spot an issue.
What?
Follow up of: #76441
PostTemplatePanelhas complex logic that has been iterated over the years to handle differently different combinations of block, classic and hybrid themes that have custom templates or not, permissions etc..In the linked PR I update the
templatefield to match the template panel controls but there are a few more nuances.I observed two cases that didn't match, that needed to be handled in
DataFormPostSummarycomponent.default template. With the experiment this translates to making the fieldreadonly.Snippet to add template support
Testing Instructions
Editor Inspector: Use DataFormexperiment for each case to validate matching behaviors.Notes
While testing I observed a bug in the existing code for classic themes that had previously template support and created templates. The control shows the created templates, but this doesn't work if the template support is not enabled and errors. I have screenshot below.
Block theme 2025
It's expected that the template panel has actions and not the DataForm field. Actions are moved here.
2015 classic theme - It has no available templates
The
templatepanel or field are not rendered2015 classic theme - It has no available templates - but with added template support
2014 classic theme - It has available templates
In the
disabledscreenshot you can see the bug I mention above with previously created templates even if now it didn't have template support.2014 classic theme - It has available templates - but with added template support