Changes from trunk/wp-includes/functions.php at r12412 to branches/2.9/wp-includes/functions.php at r12508
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.9/wp-includes/functions.php
r12412 r12508 3394 3394 static $mo_loaded = false; 3395 3395 3396 $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific' , 'Etc');3396 $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific'); 3397 3397 3398 3398 // Load translations for continents and cities … … 3408 3408 $zone = explode( '/', $zone ); 3409 3409 if ( !in_array( $zone[0], $continents ) ) { 3410 continue;3411 }3412 if ( 'Etc' === $zone[0] && in_array( $zone[1], array( 'UCT', 'GMT', 'GMT0', 'GMT+0', 'GMT-0', 'Greenwich', 'Universal', 'Zulu' ) ) ) {3413 3410 continue; 3414 3411 } … … 3453 3450 // Continent optgroup 3454 3451 if ( !isset( $zonen[$key - 1] ) || $zonen[$key - 1]['continent'] !== $zone['continent'] ) { 3455 $label = ( 'Etc' === $zone['continent'] ) ? __( 'Manual offsets' ) :$zone['t_continent'];3452 $label = $zone['t_continent']; 3456 3453 $structure[] = '<optgroup label="'. esc_attr( $label ) .'">'; 3457 3454 } … … 3459 3456 // Add the city to the value 3460 3457 $value[] = $zone['city']; 3461 if ( 'Etc' === $zone['continent'] ) { 3462 if ( 'UTC' === $zone['city'] ) { 3463 $display = ''; 3464 } else { 3465 $display = str_replace( 'GMT', '', $zone['city'] ); 3466 $display = strtr( $display, '+-', '-+' ) . ':00'; 3467 } 3468 $display = sprintf( __( 'UTC %s' ), $display ); 3469 } else { 3470 $display = $zone['t_city']; 3471 if ( !empty( $zone['subcity'] ) ) { 3472 // Add the subcity to the value 3473 $value[] = $zone['subcity']; 3474 $display .= ' - ' . $zone['t_subcity']; 3475 } 3458 3459 $display = $zone['t_city']; 3460 if ( !empty( $zone['subcity'] ) ) { 3461 // Add the subcity to the value 3462 $value[] = $zone['subcity']; 3463 $display .= ' - ' . $zone['t_subcity']; 3476 3464 } 3477 3465 } … … 3491 3479 } 3492 3480 3481 // Do UTC 3482 $structure[] = '<optgroup label="'. esc_attr__( 'UTC' ) .'">'; 3483 $selected = ''; 3484 if ( 'UTC' === $selected_zone ) 3485 $selected = 'selected="selected" '; 3486 $structure[] = '<option ' . $selected . 'value="' . esc_attr( 'UTC' ) . '">' . __('UTC') . '</option>'; 3487 $structure[] = '</optgroup>'; 3488 3489 // Do manual UTC offsets 3490 $structure[] = '<optgroup label="'. esc_attr__( 'Manual Offsets' ) .'">'; 3491 $offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5, 3492 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 5.75, 6, 6.5, 7, 7.5, 8, 8.5, 8.75, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 13.75, 14); 3493 foreach ( $offset_range as $offset ) { 3494 if ( 0 <= $offset ) 3495 $offset_name = '+' . $offset; 3496 else 3497 $offset_name = (string) $offset; 3498 3499 $offset_value = $offset_name; 3500 $offset_name = str_replace(array('.25','.5','.75'), array(':15',':30',':45'), $offset_name); 3501 $offset_name = 'UTC' . $offset_name; 3502 $offset_value = 'UTC' . $offset_value; 3503 $selected = ''; 3504 if ( $offset_value === $selected_zone ) 3505 $selected = 'selected="selected" '; 3506 $structure[] = '<option ' . $selected . 'value="' . esc_attr( $offset_value ) . '">' . esc_html( $offset_name ) . "</option>"; 3507 3508 } 3509 $structure[] = '</optgroup>'; 3510 3493 3511 return join( "\n", $structure ); 3494 3512 }
Note: See TracChangeset
for help on using the changeset viewer.