-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Sort templates and template parts by slug #48473
Conversation
Should we push custom ones to the bottom here too? |
I'm not certain, I feel for instance that ideal "Page" and "Custom Page" should be close to each other but that's hard to know using a sort algorithm. If we do push custom ones to the bottom, maybe we should separate them somehow in the UI? |
Size Change: +69 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Probably, yes. We'd want to introduce some visual separators in that case. Seems fine to start at least with this and refine. |
I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: 19af130 |
Should we follow up to push 404 to the bottom of the list? There's something a little awkward about seeing it at the top 🤔 |
closes #38378
What?
The list of templates and template parts in the site editor is sorted randomly using the "last save date". This PR applies a more consistent sorting algorithm (sort by slug/name).
How
The REST API for templates/template parts don't support sorting yet, I decided to not implement it there, that late in 6.2 cycle and just went with a JS sort since we already have all the templates locally.
Testing Instructions
1- Open the site editor
2- Make edits to templates or template parts
3- The order in the sidebar should remain stable.