Sorts themes by name.
Parameters
$themes
WP_Theme[]required- Array of theme objects to sort (passed by reference).
Source
public static function sort_by_name( &$themes ) {
if ( str_starts_with( get_user_locale(), 'en_' ) ) {
uasort( $themes, array( 'WP_Theme', '_name_sort' ) );
} else {
foreach ( $themes as $key => $theme ) {
$theme->translate_header( 'Name', $theme->headers['Name'] );
}
uasort( $themes, array( 'WP_Theme', '_name_sort_i18n' ) );
}
}
Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.