Make WordPress Core

Changeset 34672


Ignore:
Timestamp:
09/28/2015 11:23:44 PM (9 years ago)
Author:
jeremyfelt
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/misc.php

    r34348 r34672  
    247247        return;
    248248
    249     // If home changed, write rewrite rules to new location.
    250     flush_rewrite_rules();
     249    if ( is_multisite() && ms_is_switched() ) {
     250        delete_option( 'rewrite_rules' );
     251    } else {
     252        flush_rewrite_rules();
     253    }
    251254}
    252255
Note: See TracChangeset for help on using the changeset viewer.