[wp-trac] [WordPress Trac] #49194: Page Template dropdown ordering should be by title, not value
WordPress Trac
noreply at wordpress.org
Thu Jun 4 12:14:48 UTC 2026
#49194: Page Template dropdown ordering should be by title, not value
-------------------------------------------------+-------------------------
Reporter: leec87 | Owner: (none)
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: Future
| Release
Component: Posts, Post Types | Version:
Severity: minor | Resolution:
Keywords: good-first-bug has-test-info has- | Focuses: ui,
patch | administration
-------------------------------------------------+-------------------------
Comment (by mattwatsoncodes):
Added `49194-sort-post-templates-by-title.diff`.
This takes the same approach as the existing PR by sorting the resolved
`$post_templates` arrays after translation and after custom block
templates are merged, but simplifies the callback to use `strnatcasecmp`
directly.
The patch also adds PHPUnit test coverage to confirm templates are sorted
by their human-readable template labels while preserving the original
template keys.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49194#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list