Ticket #16970: 16970.2.patch
File 16970.2.patch, 4.5 KB (added by , 14 years ago) |
---|
-
wp-admin/options-general.php
### Eclipse Workspace Patch 1.0 #P wordpress-trunk
135 135 <?php } ?> 136 136 <tr> 137 137 <?php 138 if ( !wp_timezone_supported() ) : // no magic timezone support here139 ?>140 <th scope="row"><label for="gmt_offset"><?php _e('Timezone') ?> </label></th>141 <td>142 <select name="gmt_offset" id="gmt_offset">143 <?php144 138 $current_offset = get_option('gmt_offset'); 145 $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,146 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);147 foreach ( $offset_range as $offset ) {148 if ( 0 < $offset )149 $offset_name = '+' . $offset;150 elseif ( 0 == $offset )151 $offset_name = '';152 else153 $offset_name = (string) $offset;154 155 $offset_name = str_replace(array('.25','.5','.75'), array(':15',':30',':45'), $offset_name);156 157 $selected = '';158 if ( $current_offset == $offset ) {159 $selected = " selected='selected'";160 $current_offset_name = $offset_name;161 }162 echo "<option value=\"" . esc_attr($offset) . "\"$selected>" . sprintf(__('UTC %s'), $offset_name) . '</option>';163 }164 ?>165 </select>166 <?php _e('hours'); ?>167 <span id="utc-time"><?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n( $time_format, false, 'gmt')); ?></span>168 <?php if ($current_offset) : ?>169 <span id="local-time"><?php printf(__('UTC %1$s is <code>%2$s</code>'), $current_offset_name, date_i18n($time_format)); ?></span>170 <?php endif; ?>171 <br />172 <span class="description"><?php _e('Unfortunately, you have to manually update this for daylight saving time. The PHP Date/Time library is not supported by your web host.'); ?></span>173 </td>174 <?php175 else: // looks like we can do nice timezone selection!176 $current_offset = get_option('gmt_offset');177 139 $tzstring = get_option('timezone_string'); 178 140 179 141 $check_zone_info = true; … … 203 165 <span id="utc-time"><?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n($timezone_format, false, 'gmt')); ?></span> 204 166 <?php if ( get_option('timezone_string') || !empty($current_offset) ) : ?> 205 167 <span id="local-time"><?php printf(__('Local time is <code>%1$s</code>'), date_i18n($timezone_format)); ?></span> 206 <?php endif; ?>207 168 <br /> 208 169 <span class="description"><?php _e('Choose a city in the same timezone as you.'); ?></span> 209 170 <?php if ($check_zone_info && $tzstring) : ?> -
wp-includes/functions.php
120 120 } 121 121 $timezone_formats = array( 'P', 'I', 'O', 'T', 'Z', 'e' ); 122 122 $timezone_formats_re = implode( '|', $timezone_formats ); 123 if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) && wp_timezone_supported()) {123 if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) ) { 124 124 $timezone_string = get_option( 'timezone_string' ); 125 125 if ( $timezone_string ) { 126 126 $timezone_object = timezone_open( $timezone_string ); … … 4028 4028 * @return float|bool 4029 4029 */ 4030 4030 function wp_timezone_override_offset() { 4031 if ( !wp_timezone_supported() ) {4032 return false;4033 }4034 4031 if ( !$timezone_string = get_option( 'timezone_string' ) ) { 4035 4032 return false; 4036 4033 } … … 4044 4041 } 4045 4042 4046 4043 /** 4047 * Check for PHP timezone support4048 *4049 * @since 2.9.04050 *4051 * @return bool4052 */4053 function wp_timezone_supported() {4054 $support = false;4055 if (4056 function_exists( 'date_create' ) &&4057 function_exists( 'date_default_timezone_set' ) &&4058 function_exists( 'timezone_identifiers_list' ) &&4059 function_exists( 'timezone_open' ) &&4060 function_exists( 'timezone_offset_get' )4061 ) {4062 $support = true;4063 }4064 return apply_filters( 'timezone_support', $support );4065 }4066 4067 /**4068 4044 * {@internal Missing Short Description}} 4069 4045 * 4070 4046 * @since 2.9.0 -
wp-includes/deprecated.php
2602 2602 return true; 2603 2603 } 2604 2604 2605 /** 2606 * Check for PHP timezone support 2607 * 2608 * @since 2.9.0 2609 * @deprecated 3.2 2610 * 2611 * @return bool 2612 */ 2613 function wp_timezone_supported() { 2614 _deprecated_function( __FUNCTION__, '3.2' ); 2615 2616 return true; 2617 } 2618