Flush rewrite rules upon theme switch
Themes can ( and do ) but shouldn't include custom rewrite rules.This can lead to hard to debug issues for theme authors. Theme changes are not a ultra common conclusion. Flushing the rewrite rules on theme switch will lead to a clean slate for each theme which helps make debugging easier. And @nacin said we should do this 5 years ago at WordCamp Mid Atlantic. Fixes #14849 git-svn-id: https://develop.svn.wordpress.org/trunk@34028 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bdd42a0902
commit
4796e96ebe
@ -1888,6 +1888,7 @@ function check_theme_switched() {
|
||||
/** This action is documented in wp-includes/theme.php */
|
||||
do_action( 'after_switch_theme', $stylesheet );
|
||||
}
|
||||
flush_rewrite_rules();
|
||||
|
||||
update_option( 'theme_switched', false );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user