Opened 6 years ago
Last modified 5 weeks ago
#49194 reviewing defect (bug)
Page Template dropdown ordering should be by title, not value
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | minor | Version: | |
| Component: | Posts, Post Types | Keywords: | good-first-bug has-test-info has-patch |
| Focuses: | ui, administration | Cc: |
Description
The ordering of items within the Page Template dropdown field is sorted by the value alphabetically, which often creates what appears to be an unordered display when viewing on the front end.
I this should be changed so the ordering of the dropdown options is based on the alphabetical order of the list items themselves.
Attachments (3)
Change History (10)
#1
@
6 years ago
- Component changed from General to Posts, Post Types
- Focuses ui administration added; accessibility removed
This ticket was mentioned in Slack in #core by sirlouen. View the logs.
7 months ago
#3
@
7 months ago
- Keywords good-first-bug needs-patch has-test-info added
- Milestone changed from Awaiting Review to Future Release
- Type changed from enhancement to defect (bug)
#4
@
7 months ago
Proposed patch sorts page templates by their human-readable name before flipping the array, ensuring UI ordering by template name, patch file uploaded.
#5
@
7 months ago
- Keywords has-patch added; needs-patch removed
- Owner set to SirLouen
- Status changed from new to reviewing
Thanks @johnnycocheroo454 I will be reviewing it asap.
#7
@
5 weeks ago
Test Report
Description
This report validates whether the indicated patch works as expected.
The patch tested was johnnycocheroo454 from @johnnycocheroo454
I tried applying 49194-sort-page-templates-by-title.patch but it failed. The modified file is not the same as in the patch.
Patch tested: https://core.trac.wordpress.org/ticket/49194
Environment
- WordPress: 7.0-beta2-20260305.115512
- PHP: 8.2.27
- Server: nginx/1.26.1
- Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.2.27)
- Browser: Firefox 148.0
- OS: Linux
- Theme: Twenty ten
- MU Plugins: None activated
- Plugins: None
- Test Reports 1.2.1
Actual Results
- ❌ Failed : The list was still following the value and not the name.
Additional Notes
- Any additional details worth mentioning.
Supplemental Artifacts
Screen captures here : https://imgur.com/a/N92QM9c
Reproduction Report
Description
✅ This report validates that the issue can be reproduced.
Environment
Testing Instructions
a-template.php,b-template.php,c-template.phpget_page_templatesActual Results
Supplemental Artifacts
Added this to functions.php:
function page_templates_admin_menu() { add_menu_page( 'Page Templates', 'Page Templates', 'manage_options', 'page-templates', 'page_templates_admin_page', 'dashicons-media-code', 81 ); } add_action( 'admin_menu', 'page_templates_admin_menu' ); function show_page_templates() { } function page_templates_admin_page() { $templates = get_page_templates(); echo '<div>'; echo '<h1>Page Templates</h1>'; echo '<ul>'; foreach ( $templates as $filename => $name ) { echo '<li>' . $name . ' (' . $filename . ')</li>'; } echo '</ul>'; echo '</div>'; }