Skip to content
Permalink
Browse files

Hotfix: Delete rewrite_rules when updating a switched site's URL.

This will be included in WordPress 4.4 and resolves an issue where
changing the site or home URL in the network admin would result in
the rewrite rules for the updated site being changed to match the
main site of the network.

https://core.trac.wordpress.org/changeset/34672
https://core.trac.wordpress.org/ticket/33816
  • Loading branch information...
jeremyfelt committed Oct 2, 2015
1 parent 2497278 commit 89225e9498fa36c70c93a7f9cd73595fa7a01116
Showing with 5 additions and 2 deletions.
  1. +5 −2 www/wordpress/wp-admin/includes/misc.php
@@ -246,8 +246,11 @@ function update_home_siteurl( $old_value, $value ) {
if ( defined( "WP_INSTALLING" ) )
return;
// If home changed, write rewrite rules to new location.
flush_rewrite_rules();
if ( is_multisite() && ms_is_switched() ) {
delete_option( 'rewrite_rules' );
} else {
flush_rewrite_rules();
}
}
/**

0 comments on commit 89225e9

Please sign in to comment.
You can’t perform that action at this time.