-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Site Editor: old template part drafts appear in the sidebar #26402
Comments
Why are we creating them in the first place? |
I'm not completely sure since they predate our work on FSE. I'm assuming it's partly to avoid loading from theme files directly, and to give special status to denote that it hasn't been changed compared to the base version, but there might have been other reasons at the time. |
In other words: all of them. 😄 Using In #26394 I'm proposing a custom status for About the issue at hand. The conversion from file happens when several conditions are met:
Some ways to alleviate this confusion could be:
|
@Copons, could you point me to any document or code that would help me understand the flow for managing |
@gziolo AFAIK there is no flow specifically for theme activation. Here you can check the gutenberg/lib/template-parts.php Lines 164 to 260 in eaf00bd
Here the gutenberg/lib/template-loader.php Lines 395 to 424 in eaf00bd
And here is the function that performs the conversion: gutenberg/lib/template-loader.php Lines 122 to 197 in eaf00bd
|
Thank you @Copons for all the pointers, much appreciated 💯 |
I'm able to reproduce the same issue. It looks like it displays template parts from all previously activated themes: I activated 3 themes that support FSE and contain template parts. For full context, I customized only one of them: Aside: It's a bit unclear for me why template parts used by the current theme aren't listed in the Template Parts section as they technically exist for the current theme, even if it's only a virtual item sourced from the template provided by the theme. |
This is likely because unpublished template parts have the Saved but unpublished template parts should be drafts instead. |
Yes, can confirm it's because In #26636 I've modified the I don't have a strong opinion about keeping |
This was fixed in #26948. |
If you switch a couple of themes that provide block template parts you can get into a state where all of the previous ones are listed:
I believe this is happening because the auto-drafts are being created for them, but there is no way to view or delete those in current
wp_template_part
listing, since the draft category is not shown.I think that it would be better to avoid displaying these theme template part drafts that were not previously modified.
The text was updated successfully, but these errors were encountered: