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 Built from https://develop.svn.wordpress.org/trunk@34028 git-svn-id: http://core.svn.wordpress.org/trunk@33997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9bf86a74d0
commit
c09b0477b2
|
@ -1888,6 +1888,7 @@ function check_theme_switched() {
|
||||||
/** This action is documented in wp-includes/theme.php */
|
/** This action is documented in wp-includes/theme.php */
|
||||||
do_action( 'after_switch_theme', $stylesheet );
|
do_action( 'after_switch_theme', $stylesheet );
|
||||||
}
|
}
|
||||||
|
flush_rewrite_rules();
|
||||||
|
|
||||||
update_option( 'theme_switched', false );
|
update_option( 'theme_switched', false );
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-34027';
|
$wp_version = '4.4-alpha-34028';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue