From c09b0477b281bd4120bb6036c0df4153aaf271e8 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Thu, 10 Sep 2015 23:50:24 +0000 Subject: [PATCH] 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 --- wp-includes/theme.php | 1 + wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 07b0f6a208..130b90e645 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -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 ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 727d08c59d..19d1786912 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @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.