-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Prevent start page options modal from opening when navigating back from template parts #74037
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
Prevent start page options modal from opening when navigating back from template parts #74037
Conversation
The start page options modal was incorrectly opening when navigating to or back from empty template parts. This occurred because template parts were not excluded from the auto-open logic, which is intended only for pages. This fix adds wp_template_part to the exclusion list alongside wp_template, ensuring the modal only appears for appropriate post types.
c1f4f4e to
5e0437d
Compare
|
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. |
|
Size Change: +9 B (0%) Total Size: 2.58 MB
ℹ️ View Unchanged
|
jeryj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! This fixes the issue of the start modal appearing when navigating backwards from a blank, new template part. I also tested that the modal appropriately appears when creating a new page.
What
Fixes a bug where the start page options modal opens when navigating to or back from empty template parts. The modal should only appear for pages, not template parts.
This bug was uncovered as part of #73919.
Why
The start page options modal is intended for pages. When navigating back from an empty template part, the component treated it as a "fresh page" because it was empty and not dirty, causing the modal to open. Template parts should be excluded from this auto-open behavior, similar to how templates (
wp_template) are already excluded.How
Adds
TEMPLATE_PART_POST_TYPEto the exclusion list in theStartPageOptionscomponent, alongside the existingTEMPLATE_POST_TYPEexclusion. This prevents the modal from auto-opening when editing template parts.Testing Instructions
Screenshots
Before
Screen.Capture.on.2025-12-16.at.11-46-06.mp4
After
Screen.Capture.on.2025-12-16.at.11-47-35.mp4