function gce_add_timezone_field() { require_once 'timezone-choices.php'; $timezone_list = gce_get_timezone_choices(); //Set selected="selected" for default option $timezone_list = str_replace('<option value="default">Default</option>', '<option value="default" selected="selected">Default</option>', $timezone_list); ?> <span class="description"><?php _e('If you are having problems with dates and times displaying in the wrong timezone, select a city in your required timezone here.', GCE_TEXT_DOMAIN); ?> </span> <br /> <?php echo $timezone_list; ?> <?php }
function gce_edit_timezone_field() { $options = get_option(GCE_OPTIONS_NAME); $options = $options[$_GET['id']]; require_once GCE_PLUGIN_ROOT . 'admin/timezone-choices.php'; $timezone_list = gce_get_timezone_choices(); //Set selected="selected" for selected timezone $timezone_list = str_replace('<option value="' . $options['timezone'] . '"', '<option value="' . $options['timezone'] . '" selected="selected"', $timezone_list); ?> <span class="description"><?php _e('If you are having problems with dates and times displaying in the wrong timezone, select a city in your required timezone here.', GCE_TEXT_DOMAIN); ?> </span> <br /> <?php echo $timezone_list; ?> <?php }