You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
List the active theme first and sort the rest by name as WordPress does #509
The Themes screen shows themes in the order internal/themehost/library.go sorts them, which is by their bytes. For themes named alba, Álvaro, Zoe, theme2 and theme10 it shows Zoe, alba, theme10, theme2, Álvaro, and the active theme keeps its place in that order. WordPress shows the active theme first, then alba, theme2, theme10, Zoe, Álvaro.
Put the active theme first in Manager.List in internal/themehost/manager.go.
Sort the other names with case ignored and numbers in natural order, as PHP strnatcasecmp does.
Why
WordPress builds the themes screen with wp_prepare_themes_for_js, which keeps the active theme on top and sorts the rest with WP_Theme::sort_by_name. So a capital letter or a number does not move a theme out of place.
Activity