Make sure rewrites are added to .htaccess immediately after activation

This commit is contained in:
Ben Word
2013-05-01 11:05:23 -05:00
parent cab26194a3
commit ec94cfb2f5
3 changed files with 5 additions and 7 deletions

View File

@@ -38,8 +38,7 @@ function roots_theme_activation_options_add_page() {
);
} else {
if (is_admin() && isset($_GET['page']) && $_GET['page'] === 'theme_activation_options') {
global $wp_rewrite;
$wp_rewrite->flush_rules();
flush_rewrite_rules();
wp_redirect(admin_url('themes.php'));
exit;
}
@@ -217,14 +216,12 @@ function roots_theme_activation_action() {
if ($roots_theme_activation_options['change_permalink_structure']) {
$roots_theme_activation_options['change_permalink_structure'] = false;
global $wp_rewrite;
if (get_option('permalink_structure') !== '/%postname%/') {
global $wp_rewrite;
$wp_rewrite->set_permalink_structure('/%postname%/');
flush_rewrite_rules();
}
$wp_rewrite->init();
$wp_rewrite->flush_rules();
}
if ($roots_theme_activation_options['change_uploads_folder']) {