wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_wp_timezone_choice_usort_callback is private and should not be used in themes or plugins directly.
_wp_timezone_choice_usort_callback › WordPress Function
Seit2.9.0
Veraltetn/v
› _wp_timezone_choice_usort_callback ( $a, $b )
Zugriff: |
|
Parameter: (2) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Sort-helper for timezones.
Ähnliche Funktionen: wp_timezone_choice, wp_check_jsonp_callback, wp_timezone_override_offset, _wp_object_count_sort_cb, wp_timezone_supported
Quellcode
function _wp_timezone_choice_usort_callback( $a, $b ) { // Don't use translated versions of Etc. if ( 'Etc' === $a['continent'] && 'Etc' === $b['continent'] ) { // Make the order of these more like the old dropdown. if ( str_starts_with( $a['city'], 'GMT+' ) && str_starts_with( $b['city'], 'GMT+' ) ) { return -1 * ( strnatcasecmp( $a['city'], $b['city'] ) ); } if ( 'UTC' === $a['city'] ) { if ( str_starts_with( $b['city'], 'GMT+' ) ) { return 1; } return -1; } if ( 'UTC' === $b['city'] ) { if ( str_starts_with( $a['city'], 'GMT+' ) ) { return -1; } return 1; } return strnatcasecmp( $a['city'], $b['city'] ); } if ( $a['t_continent'] === $b['t_continent'] ) { if ( $a['t_city'] === $b['t_city'] ) { return strnatcasecmp( $a['t_subcity'], $b['t_subcity'] ); } return strnatcasecmp( $a['t_city'], $b['t_city'] ); } else { // Force Etc to the bottom of the list. if ( 'Etc' === $a['continent'] ) { return 1; } if ( 'Etc' === $b['continent'] ) { return -1; } return strnatcasecmp( $a['t_continent'], $b['t_continent'] ); } }