Skip to content

Instantly share code, notes, and snippets.

@lucasstark
Created February 3, 2016 12:04
Show Gist options
  • Save lucasstark/8af76add84b5cfd60977 to your computer and use it in GitHub Desktop.
Save lucasstark/8af76add84b5cfd60977 to your computer and use it in GitHub Desktop.
Reset all timezones in wordpress multisite.
<?php
add_action('init', 'maybe_reset_timezone');
function maybe_reset_timezone(){
if (isset($_GET['temp-reset-timezone'])) {
$sites = wp_get_sites();
foreach($sites as $site){
switch_to_blog($site['blog_id']);
update_option('gmt_offset', '');
update_option('timezone_string', 'America/Chicago');
restore_current_blog();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment