Ticket #23132: 23132.patch
File 23132.patch, 1.1 KB (added by , 12 years ago) |
---|
-
wp-includes/functions.php
3262 3262 * @return float|bool 3263 3263 */ 3264 3264 function wp_timezone_override_offset() { 3265 if ( !$timezone_string = get_option( 'timezone_string' ) ) { 3266 return false; 3265 static $gmt_offset; 3266 3267 if ( ! isset( $gmt_offset ) ) { 3268 $gmt_offset = false; 3269 $timezone_string = get_option( 'timezone_string' ); 3270 if ( $timezone_string ) { 3271 $timezone_object = timezone_open( $timezone_string ); 3272 $datetime_object = date_create(); 3273 if ( false !== $timezone_object && false !== $datetime_object ) 3274 $gmt_offset = round( timezone_offset_get( $timezone_object, $datetime_object ) / HOUR_IN_SECONDS, 2 ); 3275 } 3267 3276 } 3268 3277 3269 $timezone_object = timezone_open( $timezone_string ); 3270 $datetime_object = date_create(); 3271 if ( false === $timezone_object || false === $datetime_object ) { 3272 return false; 3273 } 3274 return round( timezone_offset_get( $timezone_object, $datetime_object ) / HOUR_IN_SECONDS, 2 ); 3278 return $gmt_offset; 3275 3279 } 3276 3280 3277 3281 /**