Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




_wp_timezone_choice_usort_callback [ WordPress Function ]

_wp_timezone_choice_usort_callback ( $a, $b )
Parameters:
  • (unknown_type) $a
  • (unknown_type) $b
Returns:
  • (int)
Defined at:



{@internal Missing Short Description}}

Source


<?php
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 ( 'GMT+' === substr$a['city'], 0) && 'GMT+' === substr$b['city'], 0) ) {
            return -
* ( strnatcasecmp$a['city'], $b['city'] ) );
        }
        if ( 
'UTC' === $a['city'] ) {
            if ( 
'GMT+' === substr$b['city'], 0) ) {
                return 
1;
            }
            return -
1;
        }
        if ( 
'UTC' === $b['city'] ) {
            if ( 
'GMT+' === substr$a['city'], 0) ) {
                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'] );
    }
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics