Ticket #10292: 10292.patch
| File 10292.patch, 2.5 KB (added by , 17 years ago) |
|---|
-
wp-includes/functions.php
3222 3222 /** 3223 3223 * Gives a nicely formatted list of timezone strings // temporary! Not in final 3224 3224 * 3225 * @param string $selectedzone - which zone should be the selectedone3225 * @param $selected_zone string Selected Zone 3226 3226 * 3227 3227 */ 3228 3228 function wp_timezone_choice( $selected_zone ) { … … 3238 3238 $mo_loaded = true; 3239 3239 } 3240 3240 3241 $zone n= array();3241 $zones = array(); 3242 3242 foreach ( timezone_identifiers_list() as $zone ) { 3243 3243 $zone = explode( '/', $zone ); 3244 3244 if ( !in_array( $zone[0], $continents ) ) { … … 3258 3258 $exists[4] = ( $exists[1] && $exists[3] ) ? true : false; 3259 3259 $exists[5] = ( $exists[2] && $exists[3] ) ? true : false; 3260 3260 3261 $zone n[] = array(3261 $zones[] = array( 3262 3262 'continent' => ( $exists[0] ? $zone[0] : '' ), 3263 3263 'city' => ( $exists[1] ? $zone[1] : '' ), 3264 3264 'subcity' => ( $exists[2] ? $zone[2] : '' ), … … 3267 3267 't_subcity' => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' ) 3268 3268 ); 3269 3269 } 3270 usort( $zone n, '_wp_timezone_choice_usort_callback' );3270 usort( $zones, '_wp_timezone_choice_usort_callback' ); 3271 3271 3272 3272 $structure = array(); 3273 3273 … … 3275 3275 $structure[] = '<option selected="selected" value="">' . __( 'Select a city' ) . '</option>'; 3276 3276 } 3277 3277 3278 foreach ( $zone nas $key => $zone ) {3278 foreach ( $zones as $key => $zone ) { 3279 3279 // Build value in an array to join later 3280 3280 $value = array( $zone['continent'] ); 3281 3281 … … 3286 3286 // It's inside a continent group 3287 3287 3288 3288 // Continent optgroup 3289 if ( !isset( $zone n[$key - 1] ) || $zonen[$key - 1]['continent'] !== $zone['continent'] ) {3289 if ( !isset( $zones[$key - 1] ) || $zones[$key - 1]['continent'] !== $zone['continent'] ) { 3290 3290 $label = ( 'Etc' === $zone['continent'] ) ? __( 'Manual offsets' ) : $zone['t_continent']; 3291 3291 $structure[] = '<optgroup label="'. esc_attr( $label ) .'">'; 3292 3292 } … … 3320 3320 $structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . "</option>"; 3321 3321 3322 3322 // Close continent optgroup 3323 if ( !empty( $zone['city'] ) && isset( $zonen[$key + 1] ) && $zonen[$key + 1]['continent'] !== $zone['continent']) {3323 if ( !empty( $zone['city'] ) && ( !isset($zones[$key + 1]) || (isset( $zones[$key + 1] ) && $zones[$key + 1]['continent'] !== $zone['continent']) ) ) { 3324 3324 $structure[] = '</optgroup>'; 3325 3325 } 3326 3326 }