diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php
index 6c9b7a1d9f..b41a9f1b2a 100644
|
a
|
b
|
final class WP_Theme implements ArrayAccess { |
| 1326 | 1326 | if ( empty( $page_templates ) ) { |
| 1327 | 1327 | return array(); |
| 1328 | 1328 | } |
| | 1329 | |
| | 1330 | /* |
| | 1331 | * Sort page templates by their human-readable template name |
| | 1332 | * instead of by filename. |
| | 1333 | * |
| | 1334 | * This ensures the Page Template dropdown in the editor UI |
| | 1335 | * is ordered alphabetically by template label. |
| | 1336 | * |
| | 1337 | * @see https://core.trac.wordpress.org/ticket/49194 |
| | 1338 | */ |
| | 1339 | uasort( |
| | 1340 | $page_templates, |
| | 1341 | static function ( $a, $b ) { |
| | 1342 | return strnatcasecmp( $a, $b ); |
| | 1343 | } |
| | 1344 | ); |
| | 1345 | |
| 1329 | 1346 | return $page_templates; |
| 1330 | 1347 | } |