WordPress.org

Make WordPress Core

Ticket #16970: 16970.2.patch

File 16970.2.patch, 4.5 KB (added by hakre, 3 years ago)
  • wp-admin/options-general.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress-trunk
     
    135135<?php } ?> 
    136136<tr> 
    137137<?php 
    138 if ( !wp_timezone_supported() ) : // no magic timezone support here 
    139 ?> 
    140 <th scope="row"><label for="gmt_offset"><?php _e('Timezone') ?> </label></th> 
    141 <td> 
    142 <select name="gmt_offset" id="gmt_offset"> 
    143 <?php 
    144138$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         else 
    153                 $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 <?php 
    175 else: // looks like we can do nice timezone selection! 
    176 $current_offset = get_option('gmt_offset'); 
    177139$tzstring = get_option('timezone_string'); 
    178140 
    179141$check_zone_info = true; 
     
    203165    <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> 
    204166<?php if ( get_option('timezone_string') || !empty($current_offset) ) : ?> 
    205167        <span id="local-time"><?php printf(__('Local time is <code>%1$s</code>'), date_i18n($timezone_format)); ?></span> 
    206 <?php endif; ?> 
    207168<br /> 
    208169<span class="description"><?php _e('Choose a city in the same timezone as you.'); ?></span> 
    209170<?php if ($check_zone_info && $tzstring) : ?> 
  • wp-includes/functions.php

     
    120120        } 
    121121        $timezone_formats = array( 'P', 'I', 'O', 'T', 'Z', 'e' ); 
    122122        $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 ) ) { 
    124124                $timezone_string = get_option( 'timezone_string' ); 
    125125                if ( $timezone_string ) { 
    126126                        $timezone_object = timezone_open( $timezone_string ); 
     
    40284028 * @return float|bool 
    40294029 */ 
    40304030function wp_timezone_override_offset() { 
    4031         if ( !wp_timezone_supported() ) { 
    4032                 return false; 
    4033         } 
    40344031        if ( !$timezone_string = get_option( 'timezone_string' ) ) { 
    40354032                return false; 
    40364033        } 
     
    40444041} 
    40454042 
    40464043/** 
    4047  * Check for PHP timezone support 
    4048  * 
    4049  * @since 2.9.0 
    4050  * 
    4051  * @return bool 
    4052  */ 
    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 /** 
    40684044 * {@internal Missing Short Description}} 
    40694045 * 
    40704046 * @since 2.9.0 
  • wp-includes/deprecated.php

     
    26022602        return true; 
    26032603} 
    26042604 
     2605/** 
     2606 * Check for PHP timezone support 
     2607 * 
     2608 * @since 2.9.0 
     2609 * @deprecated 3.2 
     2610 * 
     2611 * @return bool 
     2612 */ 
     2613function wp_timezone_supported() { 
     2614        _deprecated_function( __FUNCTION__, '3.2' ); 
     2615 
     2616        return true; 
     2617} 
     2618