Created
July 14, 2014 20:07
-
-
Save EdHurtig/728d9a4381b53a19b349 to your computer and use it in GitHub Desktop.
Updates the timezone on all WordPress sites to the specified PHP timezone
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 | |
$timezone = 'America/New_York'; | |
$blogs = wp_get_sites(); | |
foreach ($blogs as $blog) { | |
switch_to_blog($blog['blog_id']); | |
echo 'Currently: ' . get_option('timezone_string') . ' for blog ' . $blog['blog_id'] . '<br />'; | |
echo (update_option('timezone_string', $timezone) ? 'Updated' : 'Did Not Update') . '<br /><br/>'; | |
restore_current_blog(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment