Skip to content

Commit

Permalink
Use built-in WordPress function to generate timezone list
Browse files Browse the repository at this point in the history
  • Loading branch information
dshanske committed Feb 4, 2017
1 parent 918406d commit 817929f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions includes/class-post-timezone.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,8 @@ public static function post_submitbox() {
if ( ! $timezone ) {
$timezone = get_option( 'timezone_string' );
}
foreach ( $tzlist as $tz ) {
echo '<option value="' . $tz . '"';
if ( $timezone === $tz ) {
echo ' selected';
}
echo '>' . $tz . '</option>';
}

echo wp_timezone_choice( $timezone );
echo '</select>';
echo '</div>';
}
Expand Down Expand Up @@ -76,7 +71,7 @@ public static function postbox_save_post_meta( $post_id ) {
return;
}
}
if ( $_POST['override_timezone'] ) {
if ( isset( $_POST['override_timezone'] ) ) {
update_post_meta( $post_id, 'geo_timezone', $_POST['timezone'] );
} else {
delete_post_meta( $post_id, 'geo_timezone' );
Expand Down

0 comments on commit 817929f

Please sign in to comment.