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

Previously, rewrite rules could be flushed and regenerated in the context of another site. Deleting the rules when in a switched state allows for them to be generated properly on the next page view.

Fixes #33816.

Built from https://develop.svn.wordpress.org/trunk@34672


git-svn-id: http://core.svn.wordpress.org/trunk@34636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2015-09-28 23:24:27 +00:00
parent 02703fae19
commit 5397416276
2 changed files with 6 additions and 3 deletions

View File

@ -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();
}
}
/**

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34671';
$wp_version = '4.4-alpha-34672';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.