Uses
Uses | Description |
---|---|
wp-includes/l10n.php: get_user_locale() | Retrieves the locale of a user. |
Sorts themes by name.
(WP_Theme[]) (Required) Array of theme objects to sort (passed by reference).
File: wp-includes/class-wp-theme.php
public static function sort_by_name( &$themes ) { if ( 0 === strpos( 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' ) ); } }
Version | Description |
---|---|
3.4.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme/sort_by_name