Allow translators to specify a default timezone string OR GMT offset. Stop doing date('Z')/3600 math for default gmt_offset, as since WP 2.9, we set server time to UTC. Server time is unreliable, so no workarounds for now. fixes #19601.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-01-29 20:04:11 +00:00
parent bdd70470e2
commit fda09f5124
1 changed files with 14 additions and 2 deletions

View File

@ -352,6 +352,18 @@ function populate_options() {
}
}
$timezone_string = '';
$gmt_offset = 0;
/* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
or a valid timezone string (America/New_York). See http://us3.php.net/manual/en/timezones.php
for all timezone strings supported by PHP.
*/
$offset_or_tz = __( '0', 'default GMT offset or timezone string' );
if ( is_numeric( $offset_or_tz ) )
$gmt_offset = $offset_or_tz;
elseif ( $offset_or_tz && in_array( $offset_or_tz, timezone_identifiers_list() ) )
$timezone_string = $offset_or_tz;
$options = array(
'siteurl' => $guessurl,
'blogname' => __('My Site'),
@ -399,7 +411,7 @@ function populate_options() {
'ping_sites' => 'http://rpc.pingomatic.com/',
'advanced_edit' => 0,
'comment_max_links' => 2,
'gmt_offset' => date('Z') / 3600,
'gmt_offset' => $gmt_offset,
// 1.5
'default_email_category' => 1,
@ -465,7 +477,7 @@ function populate_options() {
'widget_rss' => array(),
// 2.8
'timezone_string' => '',
'timezone_string' => $timezone_string,
// 2.9
'embed_autourls' => 1,