Created
February 3, 2016 12:04
-
-
Save lucasstark/8af76add84b5cfd60977 to your computer and use it in GitHub Desktop.
Reset all timezones in wordpress multisite.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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