Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function ds_flush_blogs_rewrite($blog) {
- global $wp_rewrite;
- switch_to_blog($blog);
- $wp_rewrite->flush_rules();
- restore_current_blog();
- }
- function update_siteurl() {
- global $wpdb;
- $sites = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->blogs"));
- foreach ( $sites as $site ) {
- $id = $site->blog_id;
- ds_flush_blogs_rewrite($id);
- $url = get_site_url($site->blog_id);
- update_blog_option($id,'siteurl',$url);
- update_blog_option($id,'home',$url);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement