Changes from branches/2.9/wp-includes/functions.php at r12508 to trunk/wp-includes/functions.php at r12412
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r12508 r12412 3394 3394 static $mo_loaded = false; 3395 3395 3396 $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific' );3396 $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific', 'Etc' ); 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' ) ) ) { 3410 3413 continue; 3411 3414 } … … 3450 3453 // Continent optgroup 3451 3454 if ( !isset( $zonen[$key - 1] ) || $zonen[$key - 1]['continent'] !== $zone['continent'] ) { 3452 $label = $zone['t_continent'];3455 $label = ( 'Etc' === $zone['continent'] ) ? __( 'Manual offsets' ) : $zone['t_continent']; 3453 3456 $structure[] = '<optgroup label="'. esc_attr( $label ) .'">'; 3454 3457 } … … 3456 3459 // Add the city to the value 3457 3460 $value[] = $zone['city']; 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']; 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 } 3464 3476 } 3465 3477 } … … 3479 3491 } 3480 3492 3481 // Do UTC3482 $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 offsets3490 $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 else3497 $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 3511 3493 return join( "\n", $structure ); 3512 3494 }
Note: See TracChangeset
for help on using the changeset viewer.